Bump to version 1.22.1
[platform/upstream/busybox.git] / console-tools / openvt.c
index e3ea71b..e523566 100644 (file)
@@ -5,9 +5,21 @@
  *  busyboxed by Quy Tonthat <quy@signal3.com>
  *  hacked by Tito <farmatito@tiscali.it>
  *
- * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 
+//usage:#define openvt_trivial_usage
+//usage:       "[-c N] [-sw] [PROG ARGS]"
+//usage:#define openvt_full_usage "\n\n"
+//usage:       "Start PROG on a new virtual terminal\n"
+//usage:     "\n       -c N    Use specified VT"
+//usage:     "\n       -s      Switch to the VT"
+/* //usage:     "\n    -l      Run PROG as login shell (by prepending '-')" */
+//usage:     "\n       -w      Wait for PROG to exit"
+//usage:
+//usage:#define openvt_example_usage
+//usage:       "openvt 2 /bin/ash\n"
+
 #include <linux/vt.h>
 #include "libbb.h"
 
@@ -144,9 +156,7 @@ int openvt_main(int argc UNUSED_PARAM, char **argv)
 
        if (!argv[0]) {
                argv--;
-               argv[0] = getenv("SHELL");
-               if (!argv[0])
-                       argv[0] = (char *) DEFAULT_SHELL;
+               argv[0] = (char *) get_shell_name();
                /*argv[1] = NULL; - already is */
        }