File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " dfmt" ,
33 "description" : " Dfmt is a formatter for D source code" ,
4- "version" : " 0.4.0-beta " ,
4+ "version" : " 0.4.0" ,
55 "targetType" : " executable" ,
66 "license" : " BSL-1.0" ,
77 "dependencies" : {
Original file line number Diff line number Diff line change 55
66module dfmt.main ;
77
8+ enum VERSION = " 0.4.0" ;
9+
810version (NoMain)
911{
1012}
2426 Config optConfig;
2527 optConfig.pattern = " *.d" ;
2628 bool showHelp;
29+ bool showVersion;
2730
2831 void handleBooleans (string option, string value)
2932 {
5861 try
5962 {
6063 getopt(args,
64+ " version" , &showVersion,
6165 " align_switch_statements" , &handleBooleans,
6266 " brace_style" , &optConfig.dfmt_brace_style,
6367 " end_of_line" , &optConfig.end_of_line,
8084 return 1 ;
8185 }
8286
87+ if (showVersion)
88+ {
89+ writeln(VERSION );
90+ return 0 ;
91+ }
92+
8393 if (showHelp)
8494 {
8595 printHelp();
@@ -149,11 +159,13 @@ else
149159
150160private void printHelp ()
151161{
152- writeln(` dfmt 0.4.0-beta
162+ writeln(` dfmt ` , VERSION , `
163+ https://github.com/Hackerpilot/dfmt
153164
154165Options:
155166 --help | -h Print this help message
156167 --inplace Edit files in place
168+ --version Print the version number and then exit
157169
158170Formatting Options:
159171 --align_switch_statements
You can’t perform that action at this time.
0 commit comments