LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 4199|回复: 15

推荐个好东西gentoo-bashcomp---Gentoo管理员的好帮手!!

[复制链接]
发表于 2005-7-1 18:25:26 | 显示全部楼层 |阅读模式
*  app-shells/gentoo-bashcomp
      Latest version available: 20050516
      Latest version installed: 20050516
      Size of downloaded files: 19 kB
      Homepage:    http://developer.berlios.de/projects/gentoo-bashcomp/
      Description: Gentoo-specific bash command-line completions (emerge, ebuild, equery, etc)
      License:     GPL-2
看一下包里都有什么epm -ql gentoo-bashcomp
/usr/share/doc/gentoo-bashcomp-20050516/TODO.gz
/usr/share/doc/gentoo-bashcomp-20050516/AUTHORS.gz
/usr/share/doc/gentoo-bashcomp-20050516/ChangeLog.gz
/usr/share/bash-completion/gentoo
/etc/bash_completion.d/gentoo
debian也有类似的。
然后随便在哪加上if [ -f /etc/bash_completion ]; then
      . /etc/bash_completion
                  fi
再用emerge,equery时---试试tab补全------哈哈---强吧---这只是皮毛---更多用法大家再写,debian,gentoo--我会一直爱你不变。
发表于 2005-7-1 18:45:49 | 显示全部楼层
用gentoo以来我一直在寻找这样一个东西
tab补全太酷了
谢谢fei
呵呵
感觉象谢我自己:我也名字尾也是飞哈哈
  1. Add the following line to your ~/.bashrc to
  2. * activate completion support in your bash:
  3. * [ -f /etc/profile.d/bash-completion ] && . /etc/profile.d/bash-completion
  4. *
  5. * Additional complete functions can be enabled by symlinking them from
  6. * /usr/share/bash-completion to /etc/bash_completion.d
复制代码

  :thank  :2cool
回复 支持 反对

使用道具 举报

发表于 2005-7-1 19:14:48 | 显示全部楼层
的确好!
回复 支持 反对

使用道具 举报

发表于 2005-7-1 19:16:42 | 显示全部楼层
太棒!之前emerge的时候总顺手TAB一下,苦于没有补全,没想到居然真的可以。
谢谢分享!

emerge -uD的时候还附带装了app-shells/bash-completion-config
  1. Utility to easily add/remove bash-completions to your environment
  2.         ......
  3.         echo
  4.         einfo "To enable command-line completion for bash-completion-config,"
  5.         einfo "run the following as root:"
  6.         einfo
  7.         einfo " bash-completion-config --global --install bash-completion-config"
  8.         echo
复制代码

不过经尝试好象与gentoo-bashcomp关联不大,谁能解释一下?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-7-1 23:13:54 | 显示全部楼层
很明显啊。/usr/bin/bash-completion-config
Usage: bash-completion-config [ options ] [ <bashcomp1> <bashcomp2> ... ]
Add/remove bash-completion function(s) to your environment

Options:
  -h,  --help        Display this help message.
  -V,  --version     Display version information.
  -d,  --debug       Enable debug-mode.
  -g,  --global      Perform operation system-wide (must be root).
                     Must be used in conjunction with --install or
                     --uninstall.
  -nc, --nocolor, --nocolour
                     Disable colored output.
  -l,  --list <all>  Lists currently enabled bash-completions (local
                     and global).  Takes an optional argument, 'all', which if
                     specified shows all completions, not just those installed.
  -i,  --install     Install specified bash-completion(s).
  -u,  --uninstall   Uninstall specified bash-completion(s).

You may specify an arbitrary number of arguments to --install and --uninstall.
The arguments may be a path, or just a name, in which case it is assumed to
exist in /usr/share/bash-completion.

Read the bash-completion-config(1) manual page for more detailed information.
# /usr/bin/bash-completion-config -l
bash-completion-config-0.8

                       | Local  Global |
----------------------------------------
gentoo                 |          *    |
----------------------------------------
epm,ebuild具然也能用tab补齐----强了。另外发现还有这个补齐portageq
>>> Portage information query tool -- version 1.13
>>> Usage: portageq <command> [<option> ...]

Available commands:
   config_protect_mask
      Returns the CONFIG_PROTECT_MASK paths as defined in the portage configuration.
      
   config_protect
      Returns the CONFIG_PROTECT paths as defined in the portage configuration.
      
   vdb_path
      Returns the path used for the var(installed) package database for the
      set environment/configuration options.
      
   gentoo_mirrors
      Returns the mirrors set to use in the portage configuration.
      
   all_best_visible <root>
      Returns all best_visible packages (without .ebuild).
      
   match <root> <category/package>
      Returns
      seperated list of category/package-version
      
   best_visible <root> [<category/package>]+
      Returns category/package-version (without .ebuild).
      
   mass_best_visible <root> [<category/package>]+
      Returns category/package-version (without .ebuild).
      
   has_version <root> <category/package>
      Return code 0 if it's available, 1 otherwise.
      
   portdir
      Returns the PORTDIR path as defined in the portage configuration.
      
   envvar <variable>
      Returns a specific environment variable as exists prior to ebuild.sh.
      Similar to: emerge --verbose --info | egrep '^<variable>='
      
   mass_best_version <root> [<category/package>]+
      Returns category/package-version (without .ebuild).
      
   best_version <root> <category/package>
      Returns category/package-version (without .ebuild).
      
   pkgdir
      Returns the PKGDIR path as defined in the portage configuration.
      
   portdir_overlay
      Returns the PORTDIR_OVERLAY path as defined in the portage configuration.
      
   distdir
      Returns the DISTDIR path as defined in the portage configuration.
      详细看了 /etc/bash_completion.d/gentoo--基本上所有带选项命令的参数都能补齐-!!比如gcc - tab,tar tab!!
还有特别特定的比如rc,rc-update,gcc-config,distcc-config,java-config,opengl-update,browser-config,ekeyword,webapp-config,ezcat
,revdep-rebuild,euse,glsa-check=====超级强啊!
回复 支持 反对

使用道具 举报

发表于 2005-7-2 09:51:24 | 显示全部楼层
我感动的流泪阿
:)
回复 支持 反对

使用道具 举报

发表于 2005-7-4 00:51:59 | 显示全部楼层
bu cuo
回复 支持 反对

使用道具 举报

发表于 2005-7-4 03:20:05 | 显示全部楼层
So cooooooooool!!!!! I'll try it!

Vielen danke, fei.
回复 支持 反对

使用道具 举报

发表于 2005-7-12 11:06:33 | 显示全部楼层
好DD啊
回复 支持 反对

使用道具 举报

发表于 2005-7-12 11:30:52 | 显示全部楼层
以前在 PHLAK 上看到这种东西口水都流干了, 没想到 Gentoo 也有了, 感谢楼主
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表