Skip to content

Command Line Interface

Commands

debug logging

You can always add --debug or -D flag into any command to display debug message.

$ rezup use

Quick start, auto use default container '.main'

The command use can be omitted

$ rezup

Use container 'foo'

$ rezup use foo

Ignore remote and only use local container

If local and remote root are both set for the container, remote will be sourced first by default even local container has newer revision. So sometimes you may want to ignore the remote.

$ rezup use foo --local

Use 'foo' and run command

Everything after -- will be passed as command.

$ rezup use foo -- rez-env

$ rezup add

Create & use new revision for local container '.main'

$ rezup add

Create & use new revision for local container 'foo'

$ rezup add foo

Create new revision for remote container '.main' and exit

$ rezup add --remote --skip-use

$ rezup drop

Not ready for prime-time

This command actually is not fully functional yet.

$ rezup status

List containers and info

$ rezup status

Show detailed info of specific container

$ rezup status foo

Shell Prompt

You may customize the prompt with environ var REZUP_PROMPT.

To get the container name for custom prompt, use env var REZUP_CONTAINER. You may also want to use REZUP_USING_REMOTE to indicate whether current rez venv session is sourced from local or remote container.

Set Prompts in Unix Shell

Due to the rcfiles, I cannot change prompt from Rezup launch script. So unless copying all rcfiles into a temp dir and modify prompt from there (just like how Rez changing prompt in sub-shell), you have to do this in your own ~/.bashrc or ~/.cshrc.

bash, zsh

# ~/.bashrc
if [ -n "${REZUP_PROMPT-}" ] ; then
    export PS1=$REZUP_PROMPT$PS1
fi

csh, tcsh

# ~/.cshrc
if ( ! $?prompt ) then
    set prompt="% "
endif
if ( $?REZUP_PROMPT ) then
    set prompt="${REZUP_PROMPT}${prompt}"
endif

Shell detection

Rezup uses an excellent tool shellingham to detect current shell for spawning sub-shell. This works great on Windows, however on POSIX, shellingham seems detecting shell with env $SHELL in most cases, which means mostly what you get is the login shell, not the current shell that is being used.

For example:

$ python3 -c "import shellingham;print(shellingham.detect_shell())"
$ ('bash', '/bin/bash')
$ csh
% python3 -c "import shellingham;print(shellingham.detect_shell())"
% ('bash', '/bin/bash')

Why $SHELL doesn't change when I run new shell?

To overcome this, use env REZUP_DEFAULT_SHELL to set the shell you want.

Notes

  • Remember to convert line ending to Unix format if shell scripts have been edited on Windows. Or may get error like ^M: Command not found.
  • May get error like Unmatched " in csh shell when the prompt contains linebreak.
Back to top