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

Improper alignment of the command list output with arguments." #1994

Open
badele opened this issue Apr 7, 2024 · 5 comments
Open

Improper alignment of the command list output with arguments." #1994

badele opened this issue Apr 7, 2024 · 5 comments

Comments

@badele
Copy link

badele commented Apr 7, 2024

Just version: 1.24

If i execute this command just --list i have this output

We can see that the just program align correctly the recipes witouth argument, that is not true for the recipes with arguments

Available recipes:
    doc-update FAKEFILENAME # Update documentation
    help                    # Help it showed if just is called without arguments
    home-build              # Home build for local user
    home-deploy             # Home deploy local user
    iso-build               # Build NixOS ISO image
    iso-clean               # Clean ISO vm test
    iso-start               # Start test NixOS ISO image
    iso-stop                # Stop ISO vm test
    iso-test                # Test ISO image (ESC for select boot device)
    iso-test-install        # Test NixOS deployment with custom ISO image (ESC for select boot device)
    iso-test-remote-deploy  # Test NixOS update deployment with custom ISO image (ESC for select boot device)
    lint                    # Lint the project
    nixos-build hostname="" options="" # Nixos build local host
    nixos-deploy hostname="" options="" # Deploy NixOS on local host
    nixos-init-host host    # Init nixos host if not exists
    nixos-install hostname targetip port="22" # Install new <hostname> to <target>:<port> system wide
    nixos-remote-deploy hostname targetip # Deploy NixOS on remote host
    packages                # Show installed packages
    passwd-generate         # Generate random password
    precommit-check         # precommit check
    precommit-install       # Setup pre-commit
    precommit-update        # Update pre-commit
    repl                    # Repl the project
    secret-update FILE      # Update secrets SOPS

From bash, we can align the just output command with just --list | column -s '#' -t -o '#'

I think it would be nice to add the fix directly to the rust code of course if it's not too complicated to modify the just command output alignment code.

Available recipes:                            #
    doc-update FAKEFILENAME                   # Update documentation
    help                                      # Help it showed if just is called without arguments
    home-build                                # Home build for local user
    home-deploy                               # Home deploy local user
    iso-build                                 # Build NixOS ISO image
    iso-clean                                 # Clean ISO vm test
    iso-start                                 # Start test NixOS ISO image
    iso-stop                                  # Stop ISO vm test
    iso-test                                  # Test ISO image (ESC for select boot device)
    iso-test-install                          # Test NixOS deployment with custom ISO image (ESC for select boot device)
    iso-test-remote-deploy                    # Test NixOS update deployment with custom ISO image (ESC for select boot device)
    lint                                      # Lint the project
    nixos-build hostname="" options=""        # Nixos build local host
    nixos-deploy hostname="" options=""       # Deploy NixOS on local host
    nixos-init-host host                      # Init nixos host if not exists
    nixos-install hostname targetip port="22" # Install new <hostname> to <target>:<port> system wide
    nixos-remote-deploy hostname targetip     # Deploy NixOS on remote host
    packages                                  # Show installed packages
    passwd-generate                           # Generate random password
    precommit-check                           # precommit check
    precommit-install                         # Setup pre-commit
    precommit-update                          # Update pre-commit
    repl                                      # Repl the project
    secret-update FILE                        # Update secrets SOPS
@johnalotoski
Copy link

I'm also interested in seeing this addressed.

@casey
Copy link
Owner

casey commented May 15, 2024

Currently, just uses a maximum line width of 30. If a recipe plus arguments is longer than 30 characters, just won't take it into consideration when aligning doc comments. This idea was to avoid a very long recipe signature causing all other lines having a huge alignment. I increased it from 30 to 50, since it was just kind of an arbitrary number, see #2039.

This could be removed entirely, or be made configurable. I'll leave this open to collect feedback. Please feel free to comment on your preference, either way.

@badele
Copy link
Author

badele commented May 19, 2024

This could be removed entirely, or be made configurable. I'll leave this open to collect feedback. Please feel free to comment on your preference, either way.

Since the code already exists, and that it is now set to 50. I think that in the future, it would be either to add the possibility of adding a command option or to read the value from the environment variable.

Note: Thank you for updating the width value

@johnalotoski
Copy link

My vote would be to make this setting configurable. Thank you!

@casey
Copy link
Owner

casey commented May 20, 2024

I'd be totally fine with making it configurable. It just takes adding a new argument to config.rs, where it can also be made configurable with an environment variable at the same time.

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

No branches or pull requests

3 participants