Skip to content

Commit da29394

Browse files
vladimyrsaghul
authored andcommitted
cli: refactor argument parsing
* cli: refactor argument parsing - implementing -v, --version flag - supporting GNU style long options with equal sign e.g. --eval="1 + 2" - removing version from help output - adjusting exit codes - improving reporting of missing arguments & unknown options - updating gitignore to include editor & os stuff
1 parent 04b18b1 commit da29394

File tree

3 files changed

+240
-143
lines changed

3 files changed

+240
-143
lines changed

.clang-format

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
1-
---
1+
---
22
AlignAfterOpenBracket: Align
3-
AlignConsecutiveMacros: 'true'
4-
AlignConsecutiveAssignments: 'false'
5-
AlignConsecutiveDeclarations: 'false'
3+
AlignConsecutiveMacros: true
4+
AlignConsecutiveAssignments: false
5+
AlignConsecutiveDeclarations: false
66
AlignEscapedNewlines: Right
7-
AlignOperands: 'true'
8-
AlignTrailingComments: 'true'
9-
AllowAllArgumentsOnNextLine: 'false'
10-
AllowAllParametersOfDeclarationOnNextLine: 'false'
11-
AllowShortBlocksOnASingleLine: 'false'
12-
AllowShortCaseLabelsOnASingleLine: 'false'
7+
AlignOperands: true
8+
AlignTrailingComments: true
9+
AllowAllArgumentsOnNextLine: false
10+
AllowAllParametersOfDeclarationOnNextLine: false
11+
AllowShortBlocksOnASingleLine: false
12+
AllowShortCaseLabelsOnASingleLine: false
1313
AllowShortFunctionsOnASingleLine: None
1414
AllowShortIfStatementsOnASingleLine: Never
15-
AllowShortLoopsOnASingleLine: 'false'
15+
AllowShortLoopsOnASingleLine: false
1616
AlwaysBreakAfterDefinitionReturnType: None
1717
AlwaysBreakAfterReturnType: None
18-
BinPackArguments: 'false'
19-
BinPackParameters: 'false'
18+
BinPackArguments: false
19+
BinPackParameters: false
2020
BreakBeforeBraces: Attach
21-
BreakBeforeTernaryOperators: 'true'
22-
ColumnLimit: '120'
23-
ContinuationIndentWidth: '4'
24-
Cpp11BracedListStyle: 'false'
25-
DerivePointerAlignment: 'false'
21+
BreakBeforeTernaryOperators: true
22+
ColumnLimit: 120
23+
ContinuationIndentWidth: 4
24+
Cpp11BracedListStyle: false
25+
DerivePointerAlignment: false
2626
IncludeBlocks: Regroup
27-
IndentCaseLabels: 'true'
27+
IndentCaseLabels: true
2828
IndentPPDirectives: None
29-
IndentWidth: '4'
30-
IndentWrappedFunctionNames: 'false'
31-
KeepEmptyLinesAtTheStartOfBlocks: 'false'
29+
IndentWidth: 4
30+
IndentWrappedFunctionNames: false
31+
KeepEmptyLinesAtTheStartOfBlocks: false
3232
Language: Cpp
33-
MaxEmptyLinesToKeep: '2'
34-
PenaltyReturnTypeOnItsOwnLine: '1000'
33+
MaxEmptyLinesToKeep: 2
34+
PenaltyReturnTypeOnItsOwnLine: 1000
3535
PointerAlignment: Right
36-
ReflowComments: 'true'
37-
SortIncludes: 'true'
38-
SpaceAfterCStyleCast: 'true'
39-
SpaceBeforeAssignmentOperators: 'true'
36+
ReflowComments: true
37+
SortIncludes: true
38+
SpaceAfterCStyleCast: true
39+
SpaceBeforeAssignmentOperators: true
4040
SpaceBeforeParens: ControlStatements
41-
SpaceInEmptyParentheses: 'false'
42-
SpacesBeforeTrailingComments: '2'
43-
SpacesInCStyleCastParentheses: 'false'
44-
SpacesInParentheses: 'false'
45-
SpacesInSquareBrackets: 'false'
46-
TabWidth: '4'
41+
SpaceInEmptyParentheses: false
42+
SpacesBeforeTrailingComments: 2
43+
SpacesInCStyleCastParentheses: false
44+
SpacesInParentheses: false
45+
SpacesInSquareBrackets: false
46+
TabWidth: 4
4747
UseTab: Never
4848

4949
...

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1+
.vscode
2+
.idea
3+
14
build/
25
src/version.h
6+
7+
.DS_Store

0 commit comments

Comments
 (0)