Browse Source

[cmdline] Add "iseq" command

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Greg Jednaszewski 13 years ago
parent
commit
3726b3d94a
1 changed files with 37 additions and 0 deletions
  1. 37
    0
      src/core/exec.c

+ 37
- 0
src/core/exec.c View File

@@ -490,3 +490,40 @@ struct command isset_command __command = {
490 490
 	.name = "isset",
491 491
 	.exec = isset_exec,
492 492
 };
493
+
494
+/** "iseq" options */
495
+struct iseq_options {};
496
+
497
+/** "iseq" option list */
498
+static struct option_descriptor iseq_opts[] = {};
499
+
500
+/** "iseq" command descriptor */
501
+static struct command_descriptor iseq_cmd =
502
+	COMMAND_DESC ( struct iseq_options, iseq_opts, 2, 2,
503
+		       "<value1> <value2>" );
504
+
505
+/**
506
+ * "iseq" command
507
+ *
508
+ * @v argc		Argument count
509
+ * @v argv		Argument list
510
+ * @ret rc		Return status code
511
+ */
512
+static int iseq_exec ( int argc, char **argv ) {
513
+	struct iseq_options opts;
514
+	int rc;
515
+
516
+	/* Parse options */
517
+	if ( ( rc = parse_options ( argc, argv, &iseq_cmd, &opts ) ) != 0 )
518
+		return rc;
519
+
520
+	/* Return success iff arguments are equal */
521
+	return ( ( strcmp ( argv[optind], argv[ optind + 1 ] ) == 0 ) ?
522
+		 0 : -ERANGE );
523
+}
524
+
525
+/** "iseq" command */
526
+struct command iseq_command __command = {
527
+	.name = "iseq",
528
+	.exec = iseq_exec,
529
+};

Loading…
Cancel
Save