{"action":"created","issue":{"url":"https://api.github.com/repos/szaghi/FLAP/issues/36","labels_url":"https://api.github.com/repos/szaghi/FLAP/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/szaghi/FLAP/issues/36/comments","events_url":"https://api.github.com/repos/szaghi/FLAP/issues/36/events","html_url":"https://github.com/szaghi/FLAP/issues/36","id":91127029,"number":36,"title":"CLAs vs options","user":{"login":"zbeekman","id":279612,"avatar_url":"https://avatars.githubusercontent.com/u/279612?v=3","gravatar_id":"","url":"https://api.github.com/users/zbeekman","html_url":"https://github.com/zbeekman","followers_url":"https://api.github.com/users/zbeekman/followers","following_url":"https://api.github.com/users/zbeekman/following{/other_user}","gists_url":"https://api.github.com/users/zbeekman/gists{/gist_id}","starred_url":"https://api.github.com/users/zbeekman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zbeekman/subscriptions","organizations_url":"https://api.github.com/users/zbeekman/orgs","repos_url":"https://api.github.com/users/zbeekman/repos","events_url":"https://api.github.com/users/zbeekman/events{/privacy}","received_events_url":"https://api.github.com/users/zbeekman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/szaghi/FLAP/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-06-26T02:02:50Z","updated_at":"2015-07-01T21:09:06Z","closed_at":"2015-07-01T15:27:54Z","body":"Does FLAP have any notion of command line arguments vs command line options? See for example https://en.wikipedia.org/wiki/Getopt#Shell and the links from there, http://www.bahmanm.com/blogs/command-line-options-how-to-parse-in-bash-using-getopt, and `man getopt`.\r\n\r\nI often want to have a program that takes some optional flags, that might have arguments, but then a list of files, directories, etc just passed as white space separated strings. Also the special `--` denotes the end of options so you can pass an argument that looks like an option but is actually treated as an argument. (I use shell globbing and [brace expansion](http://wiki.bash-hackers.org/syntax/expansion/brace) to construct lists of stuff to process.) For example I have a code that will take ascii tecplot data files, each one corresponding to a flow snapshot, and average them across snapshots. The code might have some options to specify different behaviors but then takes a list of files to average as the rest of the arguments. After the options are processed there are an arbitrary number of positional arguments. Looking through the documentation I can’t figure out whether FLAP already supports this usage case, and if so, how one would tell FLAP to loop over the remaining arguments not corresponding to option flags/switches.\r\n\r\nI would be invoking such a program like this:\r\n`process_things --working-dir=../path/to/data --no-zones -- *H 0{0..2}{0..9}{0,5}h`\r\nThe stuff between `process_things` and `--` (which in this case is pretty much optional unless the shell glob `*H` expands to something that looks like an option, say `-fooH` or something like that) are flags/options to modify the behavior. These are the type of things FLAP already handles and handles well. (The `=` syntax isn’t required; I don’t know whether FLAP supports this already or not, a space would be fine instead of `=`) Then after the program processes the options, and sets default values etc. a loop is run over the remaining CLAs which are expanded by the shell via globbing or brace expansion etc. or from the output of some other command like `process_things -v --working-dir=../path/to/data/ -- $(command_to_generate_remaining_args)` I have some code that kinda-sorta emulate `getopt` but FLAP does a lot of it much better."},"comment":{"url":"https://api.github.com/repos/szaghi/FLAP/issues/comments/117825356","html_url":"https://github.com/szaghi/FLAP/issues/36#issuecomment-117825356","issue_url":"https://api.github.com/repos/szaghi/FLAP/issues/36","id":117825356,"user":{"login":"zbeekman","id":279612,"avatar_url":"https://avatars.githubusercontent.com/u/279612?v=3","gravatar_id":"","url":"https://api.github.com/users/zbeekman","html_url":"https://github.com/zbeekman","followers_url":"https://api.github.com/users/zbeekman/followers","following_url":"https://api.github.com/users/zbeekman/following{/other_user}","gists_url":"https://api.github.com/users/zbeekman/gists{/gist_id}","starred_url":"https://api.github.com/users/zbeekman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zbeekman/subscriptions","organizations_url":"https://api.github.com/users/zbeekman/orgs","repos_url":"https://api.github.com/users/zbeekman/repos","events_url":"https://api.github.com/users/zbeekman/events{/privacy}","received_events_url":"https://api.github.com/users/zbeekman/received_events","type":"User","site_admin":false},"created_at":"2015-07-01T21:09:06Z","updated_at":"2015-07-01T21:09:06Z","body":"circling back to the original topic, I took a look at the implementation and it looks good! My only objection is calling the stuff after `--` garbage. It is often the most critical input to the entire program! This is a just a small complaint though. If I work up a PR with git submodules etc. I may reword some of your references to “garbage”"}}