Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make FLAP CLI Posix compliant #13

Closed
szaghi opened this issue Apr 14, 2015 · 5 comments
Closed

Make FLAP CLI Posix compliant #13

szaghi opened this issue Apr 14, 2015 · 5 comments

Comments

@szaghi
Copy link
Owner

szaghi commented Apr 14, 2015

FLAP has (presently) a CLI output looking very "personal"... It is better to change the default "appearance" in order to make it more close to a compliant POSIX CLI.

References:

@zbeekman
Copy link
Contributor

+1 for posix compliance

@szaghi
Copy link
Owner Author

szaghi commented Apr 15, 2015

Thank you Izaak,

I have just uploaded a new version (0.0.5) aimed to be more POSIX compliant; if you run the test-driver program with the default settings it looks like:

default help

usage:  Test_Driver  [value] --string value [--integer value] [--real value] [--boolean] [--boolean_val value] [--integer_list value#1 value#2 value#3] [--help] [--version]

 Required options:
   --string value, -s value
       String input; required

 Optional options:
   value
       Positional real input; 1-th positional CLA; optional, default value 1.0
   --integer value, -i value, value in: (1,3,5)
       Integer input with fixed range; optional, default value 1
   --real value, -r value
       Real input; optional, default value 1.0
   --boolean, -b
       Boolean input; optional, default value .false.
   --boolean_val value, -bv value
       Valued boolean input; optional, default value .true.
   --integer_list value#1 value#2 value#3, -il value#1 value#2 value#3
       Integer list input; optional, default value 1 8 32
   --help, -h
       Print this help message; optional
   --version, -v
       Print version; optional

 Examples:
   -) Test_Driver -s 'Hello FLAP'
   -) Test_Driver -s 'Hello FLAP' -i -2 # printing error...
   -) Test_Driver -s 'Hello FLAP' -i 3 -r 33.d0
   -) Test_Driver -s 'Hello FLAP' --integer_list 10 -3 87
   -) Test_Driver 33.0 -s 'Hello FLAP' -i 5
   -) Test_Driver --string 'Hello FLAP' --boolean

wrong required arguments numbers

Test_Driver: error: too few arguments (0) respect the required (1)
usage:  Test_Driver  [value] --string value [--integer value] [--real value] [--boolean] [--boolean_val value] [--integer_list value#1 value#2 value#3] [--help] [--version]

 Required options:
   --string value, -s value
       String input; required

 Optional options:
   value
       Positional real input; 1-th positional CLA; optional, default value 1.0
   --integer value, -i value, value in: (1,3,5)
       Integer input with fixed range; optional, default value 1
   --real value, -r value
       Real input; optional, default value 1.0
   --boolean, -b
       Boolean input; optional, default value .false.
   --boolean_val value, -bv value
       Valued boolean input; optional, default value .true.
   --integer_list value#1 value#2 value#3, -il value#1 value#2 value#3
       Integer list input; optional, default value 1 8 32
   --help, -h
       Print this help message; optional
   --version, -v
       Print version; optional

 Examples:
   -) Test_Driver -s 'Hello FLAP'
   -) Test_Driver -s 'Hello FLAP' -i -2 # printing error...
   -) Test_Driver -s 'Hello FLAP' -i 3 -r 33.d0
   -) Test_Driver -s 'Hello FLAP' --integer_list 10 -3 87
   -) Test_Driver 33.0 -s 'Hello FLAP' -i 5
   -) Test_Driver --string 'Hello FLAP' --boolean

Do you such an appearance? Do you have any suggestions?

My best regards.

@szaghi
Copy link
Owner Author

szaghi commented Apr 17, 2015

I am going to close this issue. I have not found a clear "STANDARD", rather some guidelines. Now the appearance looks more like many other POSIX tools. I am satisfied.

@zbeekman
Copy link
Contributor

Looks good to me. IIRC I think posix long options are supposed to be separated from their arguments with = rather than a space, but I could be wrong, and things look good the way they are, so I would’t change things from the way they are now.

@szaghi
Copy link
Owner Author

szaghi commented Apr 17, 2015

Thank you Izaak, your opinion is always interesting for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants