2
2
* pstree.c - display process tree
4
4
* Copyright (C) 1993-2002 Werner Almesberger
5
* Copyright (C) 2002-2008 Craig Small
5
* Copyright (C) 2002-2009 Craig Small
7
7
* This program is free software; you can redistribute it and/or modify
8
8
* it under the terms of the GNU General Public License as published by
813
816
" [ -A | -G | -U ] [ PID | USER ]\n"
815
818
"Display a tree of processes.\n\n"
816
" -a show command line arguments\n"
817
" -A use ASCII line drawing characters\n"
818
" -c don't compact identical subtrees\n"
819
" -h highlight current process and its ancestors\n"
820
" -H PID highlight this process and its ancestors\n"
821
" -G use VT100 line drawing characters\n"
822
" -l don't truncate long lines\n"
823
" -n sort output by PID\n"
824
" -p show PIDs; implies -c\n"
825
" -u show uid transitions\n"
826
" -U use UTF-8 (Unicode) line drawing characters\n"
827
" -V display version information\n"));
819
" -a, --arguments show command line arguments\n"
820
" -A, --ascii use ASCII line drawing characters\n"
821
" -c, --compact don't compact identical subtrees\n"
822
" -h, --highlight-all highlight current process and its ancestors\n"
824
" --highlight-pid=PID highlight this process and its ancestors\n"
825
" -G, --vt100 use VT100 line drawing characters\n"
826
" -l, --long don't truncate long lines\n"
827
" -n, --numeric-sort sort output by PID\n"
828
" -p, --show-pids show PIDs; implies -c\n"
829
" -u, --uid-changes show uid transitions\n"
830
" -U, --unicode use UTF-8 (Unicode) line drawing characters\n"
831
" -V, --version display version information\n"));
828
832
#ifdef WITH_SELINUX
829
833
fprintf (stderr, _(
830
" -Z show SELinux security contexts\n"));
834
" -Z show SELinux security contexts\n"));
831
835
#endif /*WITH_SELINUX*/
832
836
fprintf (stderr, _(
833
" PID start at this PID; default is 1 (init)\n"
834
" USER show only trees rooted at processes of this user\n\n"));
837
" PID start at this PID; default is 1 (init)\n"
838
" USER show only trees rooted at processes of this user\n\n"));
840
844
fprintf(stderr, _("pstree (PSmisc) %s\n"), VERSION);
841
845
fprintf(stderr, _(
842
"Copyright (C) 1993-2005 Werner Almesberger and Craig Small\n\n"));
846
"Copyright (C) 1993-2009 Werner Almesberger and Craig Small\n\n"));
843
847
fprintf(stderr, _(
844
848
"PSmisc comes with ABSOLUTELY NO WARRANTY.\n"
845
849
"This is free software, and you are welcome to redistribute it under\n"
866
struct option options[] = {
867
{"arguments", 0, NULL, 'a'},
868
{"ascii", 0, NULL, 'A'},
869
{"compact", 0, NULL, 'c'},
870
{"vt100", 0, NULL, 'G'},
871
{"highlight-all", 0, NULL, 'h'},
872
{"highlight-pid", 1, NULL, 'H'},
873
{"numeric-sort", 0, NULL, 'n'},
874
{"show-pids", 0, NULL, 'p'},
875
{"long", 0, NULL, 'l'},
876
{"uid-changes", 0, NULL, 'u'},
877
{"unicode", 0, NULL, 'U'},
878
{"version", 0, NULL, 'V'},
880
{"security-context", 0, NULL, 'Z'},
881
#endif /*WITH_SELINUX*/
862
884
if (ioctl (1, TIOCGWINSZ, &winsz) >= 0)
863
885
if (winsz.ws_col)
864
886
output_width = winsz.ws_col;
903
925
#ifdef WITH_SELINUX
904
while ((c = getopt (argc, argv, "aAcGhH:npluUVZ")) != EOF)
926
while ((c = getopt_long (argc, argv, "aAcGhH:npluUVZ", options, NULL)) != -1)
905
927
#else /*WITH_SELINUX*/
906
while ((c = getopt (argc, argv, "aAcGhH:npluUV")) != EOF)
928
while ((c = getopt_long (argc, argv, "aAcGhH:npluUV", options, NULL)) != -1)
907
929
#endif /*WITH_SELINUX*/