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

Drop old cli flags #322

Merged
merged 1 commit into from
Aug 28, 2018
Merged

Drop old cli flags #322

merged 1 commit into from
Aug 28, 2018

Conversation

vektah
Copy link
Collaborator

@vektah vektah commented Aug 27, 2018

Removes all of the poorly named flags (eg package, modelPackage and exec) that now live in config, and switch to urvaf/cli to remove all the nasty global state in flag parsing.

gqlgen help
NAME:
   gqlgen - generate a graphql server based on schema

USAGE:
   gqlgen [global options] command [command options] [arguments...]

DESCRIPTION:
   This is a library for quickly creating strictly typed graphql servers in golang. See https://gqlgen.com/ for a getting started guide.

COMMANDS:
     generate  generate a graphql server based on schema
     init      create a new gqlgen project
     help, h   Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --verbose, -v             show logs
   --config value, -c value  the config filename
   --help, -h                show help

init has a few extra knobs that were being conflated with gen

$ gqlgen help init
NAME:
   gqlgen generate - generate a graphql server based on schema

USAGE:
   gqlgen generate [command options] [arguments...]

OPTIONS:
   --verbose, -v             show logs
   --config value, -c value  the config filename
   
roci :: 99designs/gqlgen » gqlgen init -h    
NAME:
   gqlgen init - create a new gqlgen project

USAGE:
   gqlgen init [command options] [arguments...]

OPTIONS:
   --verbose, -v             show logs
   --config value, -c value  the config filename
   --server value            where to write the server stub to (default: "server/server.go")
   --schema value            where to write the schema stub to (default: "schema.graphql")

I have:

  • Added tests covering the bug / feature (see testing) - already covered
  • Updated any relevant documentation (see docs) - already covered

@vektah vektah requested a review from creativej August 28, 2018 00:40
@creativej
Copy link
Member

Looks good it's definitely much simpler and easier to read.
This looks like it deletes the cmd override of specific config values such as exec.files and etc.
Is that because they're not needed anymore?

@vektah
Copy link
Collaborator Author

vektah commented Aug 28, 2018

Yeah, sorry if that wasn't clear from the PR description. All of the config overriding flags are gone.

@vektah vektah merged commit 40943c6 into master Aug 28, 2018
@vektah vektah deleted the drop-old-flags branch August 28, 2018 02:47
cgxxv pushed a commit to cgxxv/gqlgen that referenced this pull request Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants