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

Integrates clap_mangen to tremor-cli #1484

Closed
wants to merge 12 commits into from

Conversation

AllMight2099
Copy link
Contributor

Integrates clap_mangen into tremor-cli and exports man pages to 'target/man-page/' directory

Pull request

Description

As discussed earlier with @mfelsche, this PR adds man page generation to tremor-cli by using the clap-mangen crate and exports the man page to the man-page directory under target. This PR adds a build.rs to the tremor-cli project and allows the pages to be generated when building the project

Related

Checklist

  • The RFC, if required, has been submitted and approved
  • Any user-facing impact of the changes is reflected in docs.tremor.rs
  • The code is tested
  • Use of unsafe code is reasoned about in a comment
  • Update CHANGELOG.md appropriately, recording any changes, bug fixes, or other observable changes in behavior
  • The performance impact of the change is measured (see below)

Performance

r? @mfelsche

path::{Path, PathBuf},
};

include!("src/cli.rs");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want to copy in the entire source here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What else would you do? We can't use our code from the src dir, but we got to have the definition at hand somehow. I don't see another way and I don't dislike this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I couldn't find another way of importing the Cli object because we need it to generate the man-page, so I did it this way

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But is there another way of doing it?

@Licenser
Copy link
Member

I did run this and take a look, it seems that the manfile is still missing quite a lot of content and not details the sub commands, perhaps they have to be generated additionally?

@mfelsche
Copy link
Member

Worst case, we need to create one manpage per subcommand or adapt clap_mangen upstream to handle subcommands better. But on the other hand, i do recall that e.g. git has 1 manpage for the global git command, and 1 for each subcommand (e.g. man 1 git-branch ). My first guess is that the structure of a man page is not optimized for commands with many subcommands. I would like to follow the model of git here. Thoughts?

@AllMight2099
Copy link
Contributor Author

AllMight2099 commented Feb 25, 2022

Just looked at the way git has man pages and it does make a lot more sense. I initially thought having one page per subcommand was a bit too much. Perhaps if we could reference them in the tremor-cli manpage and then add more details to it's page, it would help users understand the subcommands better.

@AllMight2099
Copy link
Contributor Author

AllMight2099 commented Feb 25, 2022

On second thought, I see that the subcommands don't have that much information which would necessitate their own man page. Does it make sense to just keep them in one man page into sections?

@coveralls
Copy link
Collaborator

coveralls commented Feb 25, 2022

Pull Request Test Coverage Report for Build 1900886967

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.01%) to 87.371%

Files with Coverage Reduction New Missed Lines %
tremor-script/src/ast/walkers.rs 1 75.35%
Totals Coverage Status
Change from base Build 1894057413: 0.01%
Covered Lines: 18735
Relevant Lines: 21443

💛 - Coveralls

dependabot bot and others added 11 commits February 26, 2022 02:59
Bumps [clap_complete](https://github.com/clap-rs/clap) from 3.0.6 to 3.1.0.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](clap-rs/clap@clap_complete-v3.0.6...clap_complete-v3.1.0)

---
updated-dependencies:
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Nishanth R <nishusheela2011@gmail.com>
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.53 to 1.0.54.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](dtolnay/anyhow@1.0.53...1.0.54)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Nishanth R <nishusheela2011@gmail.com>
…arget/man-pages' directory

Signed-off-by: Nishanth R <nishusheela2011@gmail.com>
Signed-off-by: Nishanth R <nishusheela2011@gmail.com>
Signed-off-by: Nishanth R <nishusheela2011@gmail.com>
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.54 to 1.0.55.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](dtolnay/anyhow@1.0.54...1.0.55)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Nishanth R <nishusheela2011@gmail.com>
Bumps [clap](https://github.com/clap-rs/clap) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](clap-rs/clap@clap_complete-v3.1.0...v3.1.1)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Nishanth R <nishusheela2011@gmail.com>
Bumps [tungstenite](https://github.com/snapview/tungstenite-rs) from 0.16.0 to 0.17.2.
- [Release notes](https://github.com/snapview/tungstenite-rs/releases)
- [Changelog](https://github.com/snapview/tungstenite-rs/blob/master/CHANGELOG.md)
- [Commits](snapview/tungstenite-rs@v0.16.0...v0.17.2)

---
updated-dependencies:
- dependency-name: tungstenite
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Nishanth R <nishusheela2011@gmail.com>
Bumps [test-case](https://github.com/frondeus/test-case) from 1.2.3 to 2.0.0.
- [Release notes](https://github.com/frondeus/test-case/releases)
- [Changelog](https://github.com/frondeus/test-case/blob/master/CHANGELOG.md)
- [Commits](frondeus/test-case@v1.2.3...v2.0.0)

---
updated-dependencies:
- dependency-name: test-case
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Nishanth R <nishusheela2011@gmail.com>
Bumps [clap](https://github.com/clap-rs/clap) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](clap-rs/clap@v3.1.1...v3.1.2)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Nishanth R <nishusheela2011@gmail.com>
Signed-off-by: Nishanth R <nishusheela2011@gmail.com>
Signed-off-by: Nishanth R <nishusheela2011@gmail.com>
@AllMight2099
Copy link
Contributor Author

AllMight2099 commented Feb 27, 2022

@Licenser @mfelsche I won't be available for 2 days cause I have my exams. I'll push in my updates and the final code after 2 days

@Licenser
Copy link
Member

Thanks for the heads up! We appriciate it, and no worries Univerity, Family, life should always come first :)

@darach
Copy link
Member

darach commented Mar 23, 2022

👋 @AllMight2099 Howdy, wondering if the final updates are ready to push/review? Looking forward to see what you've done with the final tweaks! 👍

@Licenser
Copy link
Member

Closing this because of inactivity.

@Licenser Licenser closed this May 20, 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.

Generate manpages from tremor-cli clap definition
5 participants