@@ -15,17 +15,17 @@ public static space := " ";
15
15
/// Data object storing information about a defined flag.
16
16
public struct Flag < traits.Stringable {
17
17
/// Name as it appears on command line.
18
- public name: string;
18
+ name: string;
19
19
20
20
/// Shortcut.
21
- public abbr: uint8;
21
+ abbr: uint8;
22
22
23
23
/// Help message.
24
- public usage: string;
24
+ usage: string;
25
25
26
26
/// Something like '<arg>' that appears in usage, and also the
27
27
/// default value, when the flag is not given.
28
- public value_desc: string;
28
+ value_desc: string;
29
29
30
30
public func to_string(&self) -> string {
31
31
return "flag:
@@ -44,33 +44,33 @@ public struct Flag < traits.Stringable {
44
44
#[boxed]
45
45
public struct FlagParser {
46
46
/// The original arguments to be parsed.
47
- public original_args: []string;
47
+ original_args: []string;
48
48
/// The index of a `--`, `none` if there is not any.
49
- public idx_dashdash: ?usize;
49
+ idx_dashdash: ?usize;
50
50
/// All options after `--` are ignored, and will be passed to the application unmodified.
51
- public all_after_dashdash: []string;
51
+ all_after_dashdash: []string;
52
52
/// When set, `--help` will print:
53
53
/// Examples:
54
54
/// $ <appname> <usage_examples[0]>
55
55
/// $ <appname> <usage_examples[1]>
56
56
/// $ ...
57
- public mut usage_examples: []string;
58
- public mut default_help_label: string := "Display this help and exit.";
59
- public mut default_version_label: string := "Show version information and exit.";
60
- public mut flags: []Flag;
57
+ mut usage_examples: []string;
58
+ mut default_help_label: string := "Display this help and exit.";
59
+ mut default_version_label: string := "Show version information and exit.";
60
+ mut flags: []Flag;
61
61
/// The current list of processed args.
62
- public mut args: []string;
63
- public mut max_free_args: usize;
64
- public mut min_free_args: usize;
65
- public mut application_name: string;
66
- public mut application_version: string;
67
- public mut application_short_description: string;
68
- public mut application_description: string;
69
- public mut args_description: string;
62
+ mut args: []string;
63
+ mut max_free_args: usize;
64
+ mut min_free_args: usize;
65
+ mut application_name: string;
66
+ mut application_version: string;
67
+ mut application_short_description: string;
68
+ mut application_description: string;
69
+ mut args_description: string;
70
70
/// Whether passing undescribed arguments is allowed.
71
- public mut allow_unknown_args: bool;
71
+ mut allow_unknown_args: bool;
72
72
/// When set, --help will display all the collected footers at the bottom.
73
- public mut footers: []string;
73
+ mut footers: []string;
74
74
75
75
/// Create a new flag parser for the given args.
76
76
public func new(args: []string) -> Self {
0 commit comments