Skip to content

Fix and install bash completion for cbmc #6776

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

Merged
merged 1 commit into from
Jun 8, 2022

Conversation

tautschnig
Copy link
Collaborator

  1. Use a pragma-free (and working) approach to extract CBMC_OPTIONS.
  2. Add completion of all completable arguments to command-line options.
  3. Make CMake's install target install the resulting bash completion
    script in etc/bash_completion.d
  4. Make the .deb package depend on bash-completion for the now-included
    completion snippet to be useful.
  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@codecov
Copy link

codecov bot commented Mar 31, 2022

Codecov Report

Merging #6776 (49d11dc) into develop (13d0c18) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           develop    #6776   +/-   ##
========================================
  Coverage    77.76%   77.76%           
========================================
  Files         1568     1568           
  Lines       180318   180318           
========================================
  Hits        140231   140231           
  Misses       40087    40087           
Impacted Files Coverage Δ
src/goto-cc/gcc_cmdline.cpp 79.23% <ø> (ø)
src/goto-cc/gcc_mode.cpp 68.47% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7856f2e...49d11dc. Read the comment docs.

@tautschnig tautschnig changed the title Fix and install bash completion for cbmc Fix and install bash completion for cbmc [depends-on: #6775] Mar 31, 2022
@tautschnig
Copy link
Collaborator Author

Requires #6775 for CI to pass.

kroening added a commit that referenced this pull request Apr 1, 2022
Avoid line break in goto-check options [blocks: #6776]
@tautschnig tautschnig force-pushed the bugfixes/auto-completion branch from 0ea77e8 to 862525d Compare April 1, 2022 17:40
@tautschnig tautschnig changed the title Fix and install bash completion for cbmc [depends-on: #6775] Fix and install bash completion for cbmc Apr 1, 2022
@tautschnig tautschnig force-pushed the bugfixes/auto-completion branch 4 times, most recently from a1bf826 to d210ef8 Compare April 2, 2022 10:16
@NlightNFotis
Copy link
Contributor

I see this has some handling of MacOS as an os - but osX uses zsh. Can that reuse that configuration or not?

(sorry, I'm in a meeting now so I can't play around extensively with this, but will have a play with this later.)

Copy link
Contributor

@NlightNFotis NlightNFotis left a comment

Choose a reason for hiding this comment

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

Okay I did play around with this a bit, and it looks good (works fine locally).

@tautschnig Could you please also update the documentation the Readme.md, at the zsh part to include:

autoload -Uz compinit
compinit

on the top of the .zshrc? That is needed unless someone is running Oh my ZSH. The source for this is https://unix.stackexchange.com/questions/339954/zsh-command-not-found-compinstall-compinit-compdef

)
install(
FILES ${CMAKE_SOURCE_DIR}/scripts/bash-autocomplete/cbmc.sh
DESTINATION etc/bash_completion.d
Copy link
Contributor

Choose a reason for hiding this comment

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

This folder doesn't exist in osX, at least not by default. Is this the correct one for that platform?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This may require playing with the brew configuration. I have /usr/local/etc/bash_completion.d/ as created by homebrew, but I'm not sure this will work just like this, or whether we need to adjust the homebrew formula.

@NlightNFotis
Copy link
Contributor

I have no idea what's up with the duplicate comments, please ignore them (I didn't create them, so I'm kind of scared to delete them in case it deletes the originals as well)

1) Use a pragma-free (and working) approach to extract CBMC_OPTIONS.
2) Add completion of all completable arguments to command-line options.
3) Make CMake's install target install the resulting bash completion
script in etc/bash_completion.d
4) Make the .deb package depend on bash-completion for the now-included
completion snippet to be useful.
@tautschnig tautschnig force-pushed the bugfixes/auto-completion branch from d210ef8 to 49d11dc Compare June 7, 2022 13:42
@tautschnig
Copy link
Collaborator Author

Okay I did play around with this a bit, and it looks good (works fine locally).

@tautschnig Could you please also update the documentation the Readme.md, at the zsh part to include:

autoload -Uz compinit
compinit

on the top of the .zshrc? That is needed unless someone is running Oh my ZSH. The source for this is https://unix.stackexchange.com/questions/339954/zsh-command-not-found-compinstall-compinit-compdef

@NlightNFotis My apologies for taking this long to get back to you (and this PR)! I have now updated the instructions, could you please (whenever time permits) take a look whether the new documentation matches your expectations?

Copy link
Contributor

@NlightNFotis NlightNFotis left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the comments with the explanation!

@tautschnig tautschnig merged commit ec66d39 into diffblue:develop Jun 8, 2022
@tautschnig tautschnig deleted the bugfixes/auto-completion branch June 8, 2022 18:22
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.

4 participants