]> git.phdru.name Git - dotfiles.git/blob - bin/PS
Feat(recode-filenames-recursive): Allow to omit parameters
[dotfiles.git] / bin / PS
1 #! /usr/bin/env python
2
3 import sys, os
4
5 args = ' '.join(sys.argv[1:])
6 if "--sort=" not in args:
7    args += " --sort=user"
8
9 pager = os.environ.get("PAGER", "more")
10 # if pager is 'less', option '-S' must be passed to it
11 if pager == 'less':
12     less = os.environ.get("LESS") or ''
13     opt = 'S'
14     if opt not in less:
15         less = opt + less
16     os.environ["LESS"] = less
17 os.system("ps %s | %s" % (args, pager))