|
@@ -381,3 +381,38 @@ struct command exit_command __command = {
|
381
|
381
|
.exec = exit_exec,
|
382
|
382
|
};
|
383
|
383
|
|
|
384
|
+/** "isset" options */
|
|
385
|
+struct isset_options {};
|
|
386
|
+
|
|
387
|
+/** "isset" option list */
|
|
388
|
+static struct option_descriptor isset_opts[] = {};
|
|
389
|
+
|
|
390
|
+/** "isset" command descriptor */
|
|
391
|
+static struct command_descriptor isset_cmd =
|
|
392
|
+ COMMAND_DESC ( struct isset_options, isset_opts, 0, MAX_ARGUMENTS,
|
|
393
|
+ "[...]", "" );
|
|
394
|
+
|
|
395
|
+/**
|
|
396
|
+ * "isset" command
|
|
397
|
+ *
|
|
398
|
+ * @v argc Argument count
|
|
399
|
+ * @v argv Argument list
|
|
400
|
+ * @ret rc Return status code
|
|
401
|
+ */
|
|
402
|
+static int isset_exec ( int argc, char **argv ) {
|
|
403
|
+ struct isset_options opts;
|
|
404
|
+ int rc;
|
|
405
|
+
|
|
406
|
+ /* Parse options */
|
|
407
|
+ if ( ( rc = parse_options ( argc, argv, &isset_cmd, &opts ) ) != 0 )
|
|
408
|
+ return rc;
|
|
409
|
+
|
|
410
|
+ /* Return success iff any arguments exist */
|
|
411
|
+ return ( ( optind == argc ) ? -ENOENT : 0 );
|
|
412
|
+}
|
|
413
|
+
|
|
414
|
+/** "isset" command */
|
|
415
|
+struct command isset_command __command = {
|
|
416
|
+ .name = "isset",
|
|
417
|
+ .exec = isset_exec,
|
|
418
|
+};
|