hi,
On Sat, Apr 20, 2013 at 3:59 PM, Hotei <
hote...@gmail.com> wrote:
> you mean like this...
>
> mdr@loki-535:~$ gofmt -flags
> flag provided but not defined: -flags
> usage: gofmt [flags] [path ...]
> -comments=true: print comments
> -cpuprofile="": write cpu profile to this file
> -d=false: display diffs instead of rewriting files
> -e=false: print all (including spurious) errors
> -l=false: list files whose formatting differs from gofmt's
> -r="": rewrite rule (e.g., 'a[b:len(a)] -> a[b:]')
> -s=false: simplify code
> -tabs=true: indent with tabs
> -tabwidth=8: tab width
> -w=false: write result to (source) file instead of stdout
>
> All you have to do is remove some noise from the output and you have your
> wish. I just don't see a problem here.
actually, I think the best way to tackle this issue is to have an
external program taking the sources of the command one wants to
generate the completion-data for (with switches for each $SHELL
flavour), compile those sources in some way (replace the
flag.PrintDefaults or just look at the AST), extract the needed infos
and generate the completion data.
and voila. bob's your uncle.
-s
>
> On Saturday, April 20, 2013 6:35:17 AM UTC-4, Archos wrote:
>>
>> Some shells to allow complete arguments to commands. e.g. for Bash, see
>> files in directory '/etc/bash_completion.d/'
>> This is very tedious since it has to be added manually but the commands
>> built in Go could do it easy.
>>
>> My proposal is that every command built should have a flag '-f' or
>> '-flags', just like '-h'; that new flag should return all flags (except "-h"
>> and "-f") set in the command.
>> In this way (which does not need a change in the API), an external command
>> could get easilly the arguments (flags) in commands built in Go.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
golang-nuts...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>