Home
last modified time | relevance | path

Searched refs:optargs (Results 1 – 25 of 213) sorted by relevance

123456789

/external/toybox/toys/other/
Dvconfig.c33 char *cmd = *toys.optargs; in vconfig_main()
43 for (i=0; i<j; i++) if (!strcmp(toys.optargs[1], types[i])) break; in vconfig_main()
46 error_exit("%s: unknown '%s'", cmd, toys.optargs[1]); in vconfig_main()
57 xstrncpy(request.device1, toys.optargs[1], sizeof(request.device1)); in vconfig_main()
61 if (toys.optargs[2]) request.u.VID = atolx_range(toys.optargs[2], 0, 4094); in vconfig_main()
67 if (toys.optargs[2]) request.u.flag = atolx_range(toys.optargs[2], 0, 1); in vconfig_main()
68 if (toys.optargs[3]) request.vlan_qos = atolx_range(toys.optargs[3], 0, 7); in vconfig_main()
71 if (toys.optargs[2]) in vconfig_main()
72 request.u.skb_priority = atolx_range(toys.optargs[2], 0, INT_MAX); in vconfig_main()
73 if (toys.optargs[3]) request.vlan_qos = atolx_range(toys.optargs[3], 0, 7); in vconfig_main()
[all …]
Dpwdx.c20 char **optargs; in pwdx_main() local
22 for (optargs = toys.optargs; *optargs; optargs++) { in pwdx_main()
25 sprintf(toybuf, "/proc/%d/cwd", atoi(*optargs)); in pwdx_main()
31 xprintf("%s: %s\n", *optargs, path); in pwdx_main()
Di2ctools.c182 i2cdetect_dash_F(atolx_range(*toys.optargs, 0, 0x3f)); in i2cdetect_main()
193 bus = atolx_range(*toys.optargs, 0, 0x3f); in i2cdetect_main()
195 first = atolx_range(toys.optargs[1], 0, 0x7f); in i2cdetect_main()
196 last = atolx_range(toys.optargs[2], 0, 0x7f); in i2cdetect_main()
234 int fd, row, addr, bus = atolx_range(toys.optargs[0], 0, 0x3f), in i2cdump_main()
235 chip = atolx_range(toys.optargs[1], 0, 0x7f); in i2cdump_main()
262 int fd, bus = atolx_range(toys.optargs[0], 0, 0x3f), in i2cget_main()
263 chip = atolx_range(toys.optargs[1], 0, 0x7f), in i2cget_main()
264 addr = (toys.optc == 3) ? atolx_range(toys.optargs[2], 0, 0xff) : -1; in i2cget_main()
283 int fd, i, bus = atolx_range(toys.optargs[0], 0, 0x3f), in i2cset_main()
[all …]
Dinsmod.c20 int fd = xopenro(*toys.optargs); in insmod_main()
24 while (toys.optargs[i] && in insmod_main()
25 strlen(toybuf) + strlen(toys.optargs[i]) + 2 < sizeof(toybuf)) in insmod_main()
27 strcat(toybuf, toys.optargs[i++]); in insmod_main()
35 char *path = !strcmp(*toys.optargs, "-") ? "/dev/stdin" : *toys.optargs; in insmod_main()
43 if (rc) perror_exit("failed to load %s", toys.optargs[0]); in insmod_main()
Ddevmem.c24 unsigned long addr = atolx(*toys.optargs); in devmem_main()
31 if ((i=stridx("1248", *toys.optargs[1]))==-1 || toys.optargs[1][1]) in devmem_main()
32 error_exit("bad width: %s", toys.optargs[1]); in devmem_main()
37 if (writing) data = atolx_range(toys.optargs[2], 0, (1ULL<<(8*bytes))-1); in devmem_main()
62 printf((!strchr(*toys.optargs, 'x')) ? "%0*lld\n" : "0x%0*llx\n", in devmem_main()
Dchrt.c69 if (toys.optflags==FLAG_p && !*toys.optargs) { in chrt_main()
83 if (!*toys.optargs) help_exit("no PRIORITY"); in chrt_main()
84 if (!toys.optargs[1] == !(toys.optflags&FLAG_p)) in chrt_main()
89 pri = atolx_range(*toys.optargs, sched_get_priority_min(pol), in chrt_main()
96 if (*(toys.optargs+1)) xexec(toys.optargs+1); in chrt_main()
Dpmap.c30 char **optargs, *line = 0; in pmap_main() local
33 for (optargs = toys.optargs; *optargs; optargs++) { in pmap_main()
36 pid_t pid = atolx(*optargs); in pmap_main()
Dpivot_root.c27 if (syscall(__NR_pivot_root, toys.optargs[0], toys.optargs[1])) in pivot_root_main()
28 perror_exit("'%s' -> '%s'", toys.optargs[0], toys.optargs[1]); in pivot_root_main()
Dchroot.c27 if (chdir(*toys.optargs) || chroot(".")) { in chroot_main()
29 perror_exit_raw(*toys.optargs); in chroot_main()
31 if (toys.optargs[1]) xexec(toys.optargs+1); in chroot_main()
Dopenvt.c92 xexec(toys.optargs); in openvt_main()
105 if (activate(open_console(), atoi(*toys.optargs))) in chvt_main()
106 perror_exit_raw(*toys.optargs); in chvt_main()
113 if (*toys.optargs) vt_num = atolx_range(*toys.optargs, 1, 63); in deallocvt_main()
/external/toybox/toys/pending/
Dgroupadd.c52 entry = xmprintf("%s:%s:%ld:", *toys.optargs, "x", TT.gid);
53 update_password(GROUP_PATH, *toys.optargs, entry);
55 entry = xmprintf("%s:%s::", *toys.optargs, "!");
56 update_password(SECURE_GROUP_PATH, *toys.optargs, entry);
70 xgetpwnam(*toys.optargs); in groupadd_main()
71 if (!(grp = getgrnam(toys.optargs[1]))) in groupadd_main()
72 error_exit("group '%s' does not exist", toys.optargs[1]); in groupadd_main()
73 if (!grp->gr_mem) entry = xmprintf("%s", *toys.optargs); in groupadd_main()
78 if (!strcmp(grp->gr_mem[i], *toys.optargs)) return; in groupadd_main()
86 entry = xrealloc(entry, strlen(entry) + strlen(*toys.optargs) + 1); in groupadd_main()
[all …]
Darp.c120 resolve_host(toys.optargs[0], &sa); in check_flags()
136 if (!toys.optargs[1]) error_exit("bad syntax"); in set_entry()
139 char *ptr = toys.optargs[1]; in set_entry()
156 xstrncpy(ifre.ifr_name, toys.optargs[1], IFNAMSIZ); in set_entry()
164 if (toys.optargs[2]) check_flags(&flags, (toys.optargs+2)); in set_entry()
169 if (FLAG(v)) xprintf("Entry set for %s\n", toys.optargs[0]); in set_entry()
192 if (toys.optargs[1]) check_flags(&flags, (toys.optargs+1)); in delete_entry()
197 if (FLAG(v)) xprintf("Delete entry for %s\n", toys.optargs[0]); in delete_entry()
226 if (!toys.optargs[0]) error_exit("-%c needs a host name", FLAG(d)?'d':'s'); in arp_main()
227 resolve_host(toys.optargs[0], &sa); in arp_main()
[all …]
Dgroupdel.c25 struct group *grp = xgetgrnam(toys.optargs[toys.optc-1]); in groupdel_main()
33 xgetpwnam(*toys.optargs); in groupdel_main()
35 if (!found && !strcmp(*toys.optargs, grp->gr_mem[i])) found++; in groupdel_main()
39 error_exit("user '%s' not in group '%s'", *toys.optargs, toys.optargs[1]); in groupdel_main()
Dgetty.c218 if (isdigit(**toys.optargs)) { in getty_main()
219 parse_speeds(*toys.optargs); in getty_main()
220 if (*++toys.optargs) TT.tty_name = xmprintf("%s", *toys.optargs); in getty_main()
222 TT.tty_name = xmprintf("%s", *toys.optargs); in getty_main()
223 if (*++toys.optargs) parse_speeds(*toys.optargs); in getty_main()
225 if (*++toys.optargs) setenv("TERM", *toys.optargs, 1); in getty_main()
Dmore.c97 loopfiles(toys.optargs, do_cat_operation); in more_main()
114 char *filename = *toys.optargs; in more_main()
161 if (*toys.optargs && *++toys.optargs) { in more_main()
162 input_key = prompt(cin, "--More--(Next file: %s)", *toys.optargs); in more_main()
165 } while (*toys.optargs); in more_main()
Duseradd.c44 char *s = *toys.optargs, *entry;
50 xexec((char *[]){"groupadd", toys.optargs[0], toys.optargs[1], 0});
67 pwd.pw_dir = TT.dir ? TT.dir : xmprintf("/home/%s", *toys.optargs);
107 if (xrun((char *[]){"groupadd", *toys.optargs, s, 0}))
155 if (xrun((char *[]){"groupadd", *toys.optargs, TT.u_grp, 0}))
/external/toybox/toys/net/
Drfkill.c35 char **optargs = toys.optargs; in rfkill_main() local
39 if (!strcmp((char *[]){"list", "block", "unblock"}[tvar], *optargs)) break; in rfkill_main()
40 if (tvar == 3) error_exit("unknown cmd '%s'", *optargs); in rfkill_main()
52 if (!*++optargs) error_exit("'%s' needs IDENTIFIER", optargs[-1]); in rfkill_main()
54 if (!strcmp(rftypes[i].name, *optargs)) break; in rfkill_main()
55 if (i == ARRAY_LEN(rftypes)) idx = atolx_range(*optargs, 0, INT_MAX); in rfkill_main()
Dftpget.c96 char *s, *remote = toys.optargs[2]; in ftpget_main()
105 if (!remote) remote = toys.optargs[1]; in ftpget_main()
108 TT.fd = xconnectany(xgetaddrinfo(*toys.optargs, TT.p, 0, SOCK_STREAM, 0, in ftpget_main()
120 ftp_line("RNFR", toys.optargs[1], 350); in ftpget_main()
121 ftp_line("RNTO", toys.optargs[2], 250); in ftpget_main()
122 } else if (toys.optflags & FLAG_M) ftp_line("MKD", toys.optargs[1], 257); in ftpget_main()
123 else if (toys.optflags & FLAG_d) ftp_line("DELE", toys.optargs[1], 250); in ftpget_main()
124 else if (toys.optflags & FLAG_D) ftp_line("RMD", toys.optargs[1], 250); in ftpget_main()
163 if (strcmp(toys.optargs[1], "-")) in ftpget_main()
164 ii = xcreate(toys.optargs[1], in ftpget_main()
/external/toybox/toys/lsb/
Dmknod.c43 type = stridx("pcub", *toys.optargs[1]); in mknod_main()
44 if (type == -1) perror_exit("bad type '%c'", *toys.optargs[1]); in mknod_main()
48 major = atoi(toys.optargs[2]); in mknod_main()
49 minor = atoi(toys.optargs[3]); in mknod_main()
55 if (mknod(*toys.optargs, mode|modes[type], dev_makedev(major, minor))) in mknod_main()
56 perror_exit_raw(*toys.optargs); in mknod_main()
Dsu.c49 if (*toys.optargs && !strcmp("-", *toys.optargs)) {
51 toys.optargs++;
54 if (*toys.optargs) name = *(toys.optargs++);
87 while ((*(argv++) = *(toys.optargs++)));
Dumount.c109 char **optargs, *pm = "/proc/mounts"; in umount_main() local
137 } else for (optargs = toys.optargs; *optargs; optargs++) { in umount_main()
138 char *abs = xabspath(*optargs, 0); in umount_main()
149 do_umount(abs ? abs : *optargs, ml ? ml->device : 0, flags); in umount_main()
/external/toybox/toys/android/
Dsendevent.c24 int fd = xopen(*toys.optargs, O_RDWR); in sendevent_main()
29 perror_exit("EVIOCGVERSION failed for %s", *toys.optargs); in sendevent_main()
33 ev.type = atoi(toys.optargs[1]); in sendevent_main()
34 ev.code = atoi(toys.optargs[2]); in sendevent_main()
35 ev.value = atoi(toys.optargs[3]); in sendevent_main()
/external/toybox/toys/example/
Dskeleton.c67 char **optargs; local
85 for (optargs = toys.optargs; *optargs; optargs++)
86 printf("optarg=%s\n", *optargs);
/external/toybox/toys/posix/
Dtest.c127 if (toys.optc) for (s = toys.optargs[--toys.optc]; *s==']'; s++); in test_main()
138 result = do_test(toys.optargs+pos, &len); in test_main()
142 if (toys.optargs[pos+1]) { in test_main()
143 if (!strcmp("!", toys.optargs[pos])) { in test_main()
147 if (!strcmp("(", toys.optargs[pos])) { in test_main()
153 result = *toys.optargs[pos++]; in test_main()
155 s = toys.optargs[pos]; in test_main()
168 s = toys.optargs[++pos]; in test_main()
Dlink.c22 if (link(toys.optargs[0], toys.optargs[1])) in link_main()
23 perror_exit("couldn't link '%s' to '%s'", toys.optargs[1], in link_main()
24 toys.optargs[0]); in link_main()

123456789