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

Add an --edit-config flag #131

Closed
CosmicHorrorDev opened this issue May 27, 2023 · 2 comments · Fixed by #285
Closed

Add an --edit-config flag #131

CosmicHorrorDev opened this issue May 27, 2023 · 2 comments · Fixed by #285
Labels
A-config Area: Config related issues/PRs C-enhancement Category: New feature or request E-easy Experience needed: Easy (good first issue)

Comments

@CosmicHorrorDev
Copy link
Collaborator

(Opening an issue for this, so that I don't forget about it)

It would be cool if:

  • The [config] file was automatically created (no copying neccessary)
  • And ideally if there was a keyboard shortcut or some other way to open to file (or at least view it's path)

Originally posted by @nicoburns in #124 (comment)

@CosmicHorrorDev CosmicHorrorDev added C-enhancement Category: New feature or request A-config Area: Config related issues/PRs labels May 27, 2023
@CosmicHorrorDev CosmicHorrorDev added the E-easy Experience needed: Easy (good first issue) label Dec 22, 2023
@kokoISnoTarget
Copy link
Contributor

Should the --edit-config flag circumvent opening a markdown file? e.g. inlyne --edit-config vs inlyne some.md --edit-config.

@CosmicHorrorDev
Copy link
Collaborator Author

Yes that would make sense, but I'm actually leaning towards making it a config subcommand instead, so that we can add other actions in the future like config set <key> <val> or config path, so I think --edit-config would fit best as inlyne config open probably?

I think overall I'm thinking

inlyne [FILE] [COMMAND]

Commands:
config  do config things
view    view a markdown document

Arguments:
[FILE]  markdown file to view

That way you can do things like

$ inlyne config open  # opens the config in an editor
$ inlyne README.md    # views the file "README.md"
$ inlyne view config  # views the file "config"

It does add in the edge cases of passing a file and a command, and passing neither which should both be CLI errors

Also worth noting that we can switch back to clap's derive API since we no longer need the full flexibility of the builder API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-config Area: Config related issues/PRs C-enhancement Category: New feature or request E-easy Experience needed: Easy (good first issue)
Projects
None yet
2 participants