Subversion Repositories SvarDOS

Rev

Rev 534 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 534 Rev 989
Line 1... Line 1...
1
/* This file is part of the SvarCOM project and is published under the terms
1
/* This file is part of the SvarCOM project and is published under the terms
2
 * of the MIT license.
2
 * of the MIT license.
3
 *
3
 *
4
 * Copyright (C) 2021 Mateusz Viste
4
 * Copyright (C) 2021-2022 Mateusz Viste
5
 *
5
 *
6
 * Permission is hereby granted, free of charge, to any person obtaining a
6
 * Permission is hereby granted, free of charge, to any person obtaining a
7
 * copy of this software and associated documentation files (the "Software"),
7
 * copy of this software and associated documentation files (the "Software"),
8
 * to deal in the Software without restriction, including without limitation
8
 * to deal in the Software without restriction, including without limitation
9
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
Line 29... Line 29...
29
static enum cmd_result cmd_echo(struct cmd_funcparam *p) {
29
static enum cmd_result cmd_echo(struct cmd_funcparam *p) {
30
  const char *arg = p->cmdline + 5;
30
  const char *arg = p->cmdline + 5;
31
 
31
 
32
  /* display help only if /? is the only argument */
32
  /* display help only if /? is the only argument */
33
  if ((p->argc == 1) && (imatch(p->argv[0], "/?"))) {
33
  if ((p->argc == 1) && (imatch(p->argv[0], "/?"))) {
34
    outputnl("Displays messages, or turns command-echoing on or off");
34
    nls_outputnl(31,0); /* "Displays messages, or turns command-echoing on or off" */
35
    outputnl("");
35
    outputnl("");
36
    outputnl("ECHO [ON | OFF]");
36
    outputnl("ECHO [ON | OFF]");
37
    outputnl("ECHO [message]");
37
    nls_outputnl(31,1); /* "ECHO [message]" */
38
    outputnl("");
38
    outputnl("");
39
    outputnl("Type ECHO without parameters to display the current echo setting.");
39
    nls_outputnl(31,2); /* "Type ECHO without parameters to display the current setting." */
40
    return(CMD_OK);
40
    return(CMD_OK);
41
  }
41
  }
42
 
42
 
43
  /* ECHO without any parameter: display current state */
43
  /* ECHO without any parameter: display current state */
44
  if (p->argc == 0) {
44
  if (p->argc == 0) {
45
    if (p->rmod->flags & FLAG_ECHOFLAG) {
45
    if (p->rmod->flags & FLAG_ECHOFLAG) {
46
      outputnl("ECHO is on");
46
      nls_outputnl(31,3); /* "ECHO is on" */
47
    } else {
47
    } else {
48
      outputnl("ECHO is off");
48
      nls_outputnl(31,4); /* "ECHO is off" */
49
    }
49
    }
50
    return(CMD_OK);
50
    return(CMD_OK);
51
  }
51
  }
52
 
52
 
53
  /* ECHO ON */
53
  /* ECHO ON */