Humanity

Edit the world by your favorite way

setupenvってスクリプト書いた

まぁちょっと前のエントリでも書いたんだけど
あれからいろんな機能追加したので紹介してみる。
めんどいのでそこそこ力入れて書いたhelpを載せてみる。

USAGE

setupenv {command} [args ...]

SYNOPSIS

$ setupenv show
Not in env.
$ setupenv list # No output
$ setupenv shell /opt/* # Add /opt/*/lib to $LD_LIBRARY_PATH, etc.
spawning new shell(/bin/zsh)...
$ # New shell started.

$ setupenv show
4069262909: /opt/atk-1.30.0/ /opt/gdk-pixbuf-2.22.0/ /opt/glib-2.27.0/ /opt/gtk+-2.20.0/

$ setupenv list # List all env(s).
4069262909: /opt/atk-1.30.0/ /opt/gdk-pixbuf-2.22.0/ /opt/glib-2.27.0/ /opt/gtk+-2.20.0/

$ setupenv create-bundle gtk+ # Bundle current env.
$ setupenv create-bundle gtk+ /opt/* # Same

$ setupenv list-bundle
gtk+: /opt/atk-1.30.0/ /opt/gdk-pixbuf-2.22.0/ /opt/glib-2.27.0/ /opt/gtk+-2.20.0/

$ exit # Exit current env.

$ setupenv bundle gtk+
spawning new shell(/bin/zsh)...
$ setupenv show
4256928019: /opt/atk-1.30.0/ /opt/gdk-pixbuf-2.22.0/ /opt/glib-2.27.0/ /opt/gtk+-2.20.0/

COMMANDS

help
Show help.

shell proj_dir [proj_dir2 ...]
Add and set up new shell.

list
List all env(s).

bundle bundle_name [bundle_name2 ...]
Expand bundle names and exec "shell" command.

create-bundle [bundle_name [proj_dir ...]]
Create a bundle.

list-bundle
List bundles.

remove-bundle bundle_name
Remove bundle.

show
Show the status whether I'm in env.