mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-21 06:11:35 +08:00
nsh: Accept the command line arguments like sh
Usage: nsh [<script-path>|-c <command>] Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: Ifb76b27e7fd09d26b1f6e48c391fed0972018041
This commit is contained in:

committed by
David Sidrane

parent
78e8090842
commit
9d80399bd5
@@ -1,7 +1,8 @@
|
||||
/****************************************************************************
|
||||
* apps/nshlib/nsh_console.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011-2013, 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009, 2011-2013, 2015 Gregory Nutt.
|
||||
* All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -180,9 +181,9 @@ static ssize_t nsh_consolewrite(FAR struct nsh_vtbl_s *vtbl,
|
||||
*/
|
||||
|
||||
if (nsh_openifnotopen(pstate) != 0)
|
||||
{
|
||||
return (ssize_t)ERROR;
|
||||
}
|
||||
{
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
/* Write the data to the output stream */
|
||||
|
||||
@@ -221,9 +222,9 @@ static int nsh_consoleoutput(FAR struct nsh_vtbl_s *vtbl,
|
||||
*/
|
||||
|
||||
if (nsh_openifnotopen(pstate) != 0)
|
||||
{
|
||||
return ERROR;
|
||||
}
|
||||
{
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
va_start(ap, fmt);
|
||||
ret = vfprintf(pstate->cn_outstream, fmt, ap);
|
||||
@@ -253,9 +254,9 @@ static int nsh_erroroutput(FAR struct nsh_vtbl_s *vtbl,
|
||||
*/
|
||||
|
||||
if (nsh_openifnotopen(pstate) != 0)
|
||||
{
|
||||
return ERROR;
|
||||
}
|
||||
{
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
va_start(ap, fmt);
|
||||
ret = vfprintf(pstate->cn_errstream, fmt, ap);
|
||||
|
Reference in New Issue
Block a user