From 831266c06862c1be6195382a02b86cb52ef304dc Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 26 Dec 2018 12:07:14 -0600 Subject: Teach the argument plumbing how to do -@ for mkfs.vfat --- lib/args.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/args.c b/lib/args.c index b24dd417..54106c25 100644 --- a/lib/args.c +++ b/lib/args.c @@ -84,6 +84,9 @@ // + Synonyms (switch on all) [+abc] means -ab=-abc, -c=-abc // ! More than one in group is error [!abc] means -ab calls error_exit() // primarily useful if you can switch things back off again. +// +// You may use octal escapes with the high bit (127) set to use a control +// character as an option flag. For example, \300 would be the option -@ // Notes from getopt man page // - and -- cannot be arguments. @@ -128,7 +131,7 @@ struct getoptflagstate unsigned excludes, requires; }; -// Use getoptflagstate to parse parse one command line option from argv +// Use getoptflagstate to parse one command line option from argv static int gotflag(struct getoptflagstate *gof, struct opts *opt) { int type; @@ -317,7 +320,7 @@ void parse_optflaglist(struct getoptflagstate *gof) continue; // Claim this option, loop to see what's after it. - } else new->c = *options; + } else new->c = 127&*options; options++; } -- cgit v1.2.3