-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(os_functions): add cmdsep function for command separation Fixes #…
- Loading branch information
1 parent
f97cbe3
commit 26bde94
Showing
7 changed files
with
101 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
%============================================================================= | ||
% Copyright (c) 2016-present Allan CORNET (Nelson) | ||
%============================================================================= | ||
% This file is part of the Nelson. | ||
%============================================================================= | ||
% LICENCE_BLOCK_BEGIN | ||
% SPDX-License-Identifier: LGPL-3.0-or-later | ||
% LICENCE_BLOCK_END | ||
%============================================================================= | ||
function varargout = cmdsep(varargin) | ||
nargoutchk(0, 1); | ||
narginchk(0, 0); | ||
if ispc() | ||
varargout{1} = "&&"; | ||
else | ||
varargout{1} = ";"; | ||
end | ||
end | ||
%============================================================================= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<xmldoc> | ||
<copyright>SAME AS NELSON SOFTWARE</copyright> | ||
|
||
<language>en_US</language> | ||
<keyword>cmdsep</keyword> | ||
<short_description | ||
>Command separator for current operating system.</short_description> | ||
|
||
<syntax> | ||
<syntax_item>sep = cmdsep()</syntax_item> | ||
</syntax> | ||
|
||
<param_output> | ||
|
||
<param_output_item> | ||
<param_name>sep</param_name> | ||
<param_description | ||
>a string: on windows "&&", on linux ";"</param_description> | ||
</param_output_item> | ||
</param_output> | ||
|
||
|
||
<description> | ||
<p><b | ||
>cmdsep</b> returns the command separator for current operating system.</p> | ||
<p | ||
>This function is used by Nelson to build command lines for unix and dos operating systems.</p> | ||
</description> | ||
|
||
<used_function /> | ||
<bibliography /> | ||
|
||
<examples> | ||
<example_item> | ||
<example_item_type>nelson</example_item_type> | ||
<example_item_description /> | ||
<example_item_data><![CDATA[unix("cd c:/ " + cmdsep() + " nelson")]]> | ||
</example_item_data> | ||
</example_item> | ||
|
||
</examples> | ||
|
||
<see_also> | ||
<see_also_item> | ||
<link linkend="${os_functions}unix">unix</link> | ||
</see_also_item> | ||
</see_also> | ||
|
||
|
||
<history> | ||
<history_item> | ||
<history_version>1.11.0</history_version> | ||
<history_description>initial version</history_description> | ||
</history_item> | ||
</history> | ||
|
||
<authors> | ||
<author_item>Allan CORNET</author_item> | ||
</authors> | ||
</xmldoc> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
%============================================================================= | ||
% Copyright (c) 2016-present Allan CORNET (Nelson) | ||
%============================================================================= | ||
% This file is part of the Nelson. | ||
%============================================================================= | ||
% LICENCE_BLOCK_BEGIN | ||
% SPDX-License-Identifier: LGPL-3.0-or-later | ||
% LICENCE_BLOCK_END | ||
%============================================================================= | ||
if ispc() | ||
assert_isequal(cmdsep(), "&&"); | ||
else | ||
assert_isequal(cmdsep(), ";"); | ||
end | ||
%============================================================================= |