Commit Graph

853 Commits

Author SHA1 Message Date
Norman Rasmussen
374cb9230a Fix boarctl typos 2022-01-16 08:07:47 +01:00
Fotis Panagiotopoulos
bc5d8034f1 Typo fixes. 2022-01-06 10:30:41 +08:00
Norman Rasmussen
6285990a5c Remove trailing whitespace from commands as parameters 2022-01-01 22:18:07 +08:00
Norman Rasmussen
92287e2b14 Fix some edge case bugs in nsh_parse
- Handle nsh_filecat returning NULL on failure
- Background and redirect must be restored after an empty line
- Output redirection should be removed from argv like background
2022-01-01 22:18:07 +08:00
Norman Rasmussen
41ce7d40f6 Fix incorrect argument count error message
The `too many arguments` and `missing required argument(s)` messages
should be switched in order for the correct message to be shown to the
user.
2021-12-31 20:54:05 +08:00
Xiang Xiao
66dbaa4539 Replace self defined macros with NET_SOCK_[FAMILY|TYPE|PROTOCOL]
NET_SOCK_* is defined by nuttx/net/netconfig.h and then can be shared

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-20 16:04:29 -03:00
ligd
a4dd508c9c nshlib/nsh_proccmds.c: update ps_callback when get Group
Cause of "Group:" always have in file "status"

Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-11-11 11:13:04 -03:00
Xiang Xiao
850c036c58 nshlib/stdsession: Handle the command arguments in any order
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-11-09 13:39:10 -03:00
Xiang Xiao
ad09ca2a80 nshlib: sync nsh_stdsession.c with nsh_session.c
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-11-09 13:39:10 -03:00
Xiang Xiao
a0f773b318 nshlib/nsh_session: Handle the command arguments in any order
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-11-09 09:35:40 -03:00
Xiang Xiao
991e491c94 nsh: Remove the duplicated NSH_MMCSDMINOR
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-11-08 10:43:47 -03:00
Xiang Xiao
35e442d08c system/readline: Move READLINE_HAVE_EXTMATCH inside SYSTEM_READLINE section
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-11-08 10:43:47 -03:00
Xiang Xiao
8b447704d3 nshlib: Disable Individual commands when DEFAULT_SMALL equals y
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-11-07 13:17:52 +01:00
anjiahao
80dcc185f3 echo: support echo opthon -e
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2021-10-21 23:33:09 -05:00
Jiuzhu Dong
5a5448df04 nsh: fix compile break about closing CONFIG_NSH_DISABLESCRIPT
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-12 11:37:19 +08:00
Jiuzhu Dong
16c9068d5f nsh: fix compile break about closing CONFIG_NSH_DISABLEBG
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-12 11:36:54 +08:00
Juha Niskanen
b283289986 apps: fix miscellaneous typos
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2021-08-26 11:39:28 -07:00
SPRESENSE
8e0892b2f2 nshlib: Fix write buffer position in nsh cp command
The iobuffer for write buffer position need to be update if write
API cannot write data at once.
2021-08-19 08:31:34 -07:00
Xiang Xiao
d4d2f13f89 Rename CONFIG_LIB_BOARDCTL to CONFIG_BOARDCTL
since boardctl isn't a libc feature

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-06 11:04:35 +02:00
Xiang Xiao
967f526850 Rename LIB_ to LIBC_ for all libc Kconfig
follow other libc component naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-05 16:42:32 +02:00
Jiuzhu Dong
32e7a7fde0 nshlib: support c++ access nsh api
N/A

Change-Id: I90de4a4ce1f089a2db2e3b81f83f7b39434d6421
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-12 04:43:36 -07:00
ligd
faa243844d apps: add variable to identify main shell
Change-Id: Ifecfbb58b3c2cdbeae900eb2eeb2b641155a7580
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-07-02 09:09:31 -07:00
liuhaitao
4b8e0fde62 nshlib: Add 'rm -r' recursive remove directory support
Change-Id: Iafecb0a25cc9d091a1aee8f381b217e67d6e3925
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2021-07-01 14:55:04 -07:00
Xiang Xiao
99e1674912 Call posix_spawn with filename as the first argv entry
pair with the kernel side change to follow the standard defintion:
https://pubs.opengroup.org/onlinepubs/009695399/functions/posix_spawn.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-14 07:12:54 -06:00
Alin Jerpelea
395b0094a5 nshlib: nxstyle fixes
fixes for errors reported by the nxstyle tool

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-06-11 02:42:05 -05:00
Alin Jerpelea
4f3f62c8fc nshlib: update licenses to Apache
Gregory Nutt is has submitted the SGA

Uros Platise has submitted the ICLA

as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-06-11 02:42:05 -05:00
Xiang Xiao
d9c1c5bbc8 Include assert.h in necessary place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-08 13:04:34 -07:00
David Sidrane
eef3e1e009 nshlib/vars: Add assert header 2021-06-08 13:19:50 -05:00
Alin Jerpelea
129aa55a36 nshlib: update licenses to Apache
Gregory Nutt is has submitted the SGA

Alan Carvalho de Assis has submitted the ICLA

as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-06-08 08:43:15 -05:00
Alin Jerpelea
ec339bc49a Makefiles: Gregory Nutt: update licenses to Apache
Gregory Nutt is the copyright holder for those files and he has submitted the
SGA as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-06-07 21:35:33 -05:00
Xiang Xiao
8e06d060c2 nsh/date: Support -u option
user can use both UTC and local time now

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-02 11:10:31 +01:00
RoCorbera
42f4565129 nsh kill cmd can be executed with no signal option.
SIGTERM is the default signal, as in unix kill command.
nsh> kill [-<signal>] <pid>
2021-06-01 15:57:13 -03:00
Xiang Xiao
98de0d6a68 nsh: Add debug.h inclusion in nsh_command.c
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-05-24 16:05:07 +09:00
Xiang Xiao
1ee948e0c8 Include assert.h for DEBUGASSERT caller
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-05-24 12:34:37 +09:00
chao.an
8721bc6847 nshlib: Fix the build break in nsh_telnetd.c when CONFIG_NSH_CONSOLE=n
set the config:
CONFIG_NSH_ROMFSETC=y
CONFIG_NSH_CONSOLE=n

nsh_telnetd.c: In function 'nsh_telnetstart':
nsh_telnetd.c:267:22: error: 'vtbl' undeclared (first use in this function)
  267 |       nsh_initscript(vtbl);
      |                      ^~~~

Signed-off-by: chao.an <anchao@xiaomi.com>
2021-05-07 10:53:25 -07:00
chao.an
a5337af484 nsh/telnetd: bringup the network before telnetd init
bringup the network before telnetd init if without NSH_CONSOLE

Signed-off-by: chao.an <anchao@xiaomi.com>
2021-05-06 19:14:47 -07:00
Anthony Merlino
267aba6467 addroute: inet_pton cannot accept slash notation. We must fixup the argument before calling. 2021-04-23 03:27:40 -05:00
Sungwoo Kim
6f4b133998 nshlib: Disable mb, mh, and mw by default
- Fix https://github.com/apache/incubator-nuttx/issues/3011

Co-authored-by: Gisu Yeo <wcharcode@gmail.com>
Co-authored-by: Taegyu Kim <tgkim@purdue.edu>
2021-04-03 09:40:18 -05:00
chao.an
960e63402e nsh/builtin: Ignore the child status if run the application on background.
N/A

fix the leak of child status if the background process
exceeds "CONFIG_PREALLOC_CHILDSTATUS".

Signed-off-by: chao.an <anchao@xiaomi.com>
2021-03-21 02:18:09 -07:00
Jiuzhu Dong
4c6ded2661 app: delete NFILE_DESCRIPTORS limits
Change-Id: I3ced2b2b7440a2c79a712cfc97b4cd15d2bddd4c
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-03-12 21:12:07 -08:00
ligd
89e6fb9a42 apps/md5: fix md5 result error
MIRTOS-325

Change-Id: I0dd6c3e155b8fe41fe8ea6859271168a0d283829
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-03-03 22:12:24 -08:00
Gustavo Henrique Nihei
5cddb39b4e nshlib: Fix dependency on FSUTILS_MKFATFS 2021-02-16 04:04:59 -08:00
Alan C. Assis
382638c8c6 Add support in printf command to send 8-32 bits value 2021-01-28 05:15:59 -08:00
Xiang Xiao
28362eb6d1 nshlib: Remove fdopen for the stdin, stdout and stderr
not really need since these file stream should be opened automatically

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-12-16 07:53:38 +09:00
Masayuki Ishikawa
0c3ee06fb3 nshlib: Fix nsh_usbconsole.c
Summary:
- stdin/stdout/stderr are now preallocated in libc and fs_fd
  in file_struct are also initialized to -1
- So we need to call fdopen() for stdin again as we did before.
- Also, cn_outstream and cn_errstream are not needed to be set.
- See apps/nshlib/nsh_console.h as well

Impact:
- nsh_usbconsole.c only

Testing:
- Tested with stm32f4discovery:usbnsh

Signed-off-by: SUZUKI Keiji <zuki.ebetsu@gmail.com>
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-12-14 04:23:26 -06:00
chao.an
fe915679b1 style/Document: remove unnecessary trailing whitespace
N/A

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-28 12:20:10 +01:00
YAMAMOTO Takashi
d6b67eb05e nshlib/nsh_dbgcmds.c: Fix a few printf warnings 2020-11-09 04:10:59 -08:00
Subhra Sankha Sarkar
3b884cfb87 Fixing coding style issues for rest of nshlib directory - except for the false +ve nsh_timcmds.c 2020-11-02 13:30:18 +01:00
Masayuki Ishikawa
305bd0e448 nshlib: Fix nsh_configstdio() in nsh_usbconsole.c
Summary:
- This commit fixes nsh_configstdio() to setup stdout and stderr

Impact:
- Affect nsh_usbconsole only

Testing:
- Tested with stm32f4discovery:usbnsh

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-10-29 20:43:59 +09:00
Xiang Xiao
e76ab9c868 Remove all fclose with stdin, stdout and stderr
since it is wrong to close the builtin stream and specially note
https://pubs.opengroup.org/onlinepubs/9699919799/functions/fclose.html:

Since after the call to fclose() any use of stream results in
undefined behavior, fclose() should not be used on stdin, stdout,
or stderr except immediately before process termination (see XBD
Process Termination), so as to avoid triggering undefined behavior
in other standard interfaces that rely on these streams. If there
are any atexit() handlers registered by the application, such a
call to fclose() should not occur until the last handler is
finishing. Once fclose() has been used to close stdin, stdout, or
stderr, there is no standard way to reopen any of these streams.

and it is also unnecessary because the stream always get flushed.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-10-29 20:43:59 +09:00