Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Noémi Shell X
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsombor Szabó-Antalovszky
Noémi Shell X
Commits
0b55c3bf
Commit
0b55c3bf
authored
5 months ago
by
My Name
Browse files
Options
Downloads
Patches
Plain Diff
Added help command
parent
83e2bfb6
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
.vscode/settings.json
+2
-1
2 additions, 1 deletion
.vscode/settings.json
README.md
+86
-82
86 additions, 82 deletions
README.md
nosh.cpp
+728
-666
728 additions, 666 deletions
nosh.cpp
nosh.exe
+0
-0
0 additions, 0 deletions
nosh.exe
with
816 additions
and
749 deletions
.vscode/settings.json
+
2
−
1
View file @
0b55c3bf
{
"files.associations"
:
{
"vector"
:
"cpp"
"vector"
:
"cpp"
,
"deque"
:
"cpp"
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
README.md
+
86
−
82
View file @
0b55c3bf
...
...
@@ -9,6 +9,8 @@ Nosh is a simple, customizable command-line shell designed for Windows systems.
`about --version`
: Display the version of the shell.
`clear`
or
`cls`
: Display the version of the shell.
`exec`
: Execute executable files.
`exit`
: Exit the shell program.
...
...
@@ -19,6 +21,8 @@ Nosh is a simple, customizable command-line shell designed for Windows systems.
`grasp -f <directory>`
: (In development) Specify a file to search for, to be implemented with the pattern matching feature.
`help`
or
`?`
: Lists all available commands for Noémi Shell.
`list`
: Display the contents of a directory or the current working directory.
`mkdir`
: Create a new directory. Usage:
`mkdir <directory_name>`
.
...
...
This diff is collapsed.
Click to expand it.
nosh.cpp
+
728
−
666
View file @
0b55c3bf
...
...
@@ -24,6 +24,17 @@
* @author ChatGPT (a lot of help)
*
* Licensed under a modified MIT License. See the license on the Noémi Shell GitLab repo for details.
*
* --------------------------------------------------------------------------------------------------------------------
*
* CHANGELOG
*
* Noémi Shell v.0.4
*
* This version introduces the 'exec' command for executing executable files.
* Exec is using the system command via the Windows API. This version also changed the 'store get'
* command to 'store -g' for improved standardization.
*
*/
...
...
@@ -36,18 +47,24 @@
#include
<cstring>
// String operations
#include
<regex>
// For grasp filtering
#include
<cstdlib>
#include
<deque>
const
char
VERSION
[]
=
"0.3.1"
;
//< Change version number here for the entire code
#define STRLEN 100 //< Max string length
const
char
VERSION
[]
=
"0.3.2"
;
///< Change version number here for the entire code
#define STRLEN 100 ///< Max string length
#define WIDTH 10 ///< Width between columns
char
vault
[
STRLEN
];
//< Storing custom info;
char
vault
[
STRLEN
];
///< Storing custom info;
deque
<
std
::
string
>
commandHistory
;
const
int
MAXHISTORY
=
50
;
int
numberOfHistories
=
0
;
///< Storing the number of histories
namespace
fs
=
std
::
filesystem
;
using
namespace
std
;
// Declaring functions
void
handle_pwd
(
const
vector
<
string
>&
args
);
bool
is_builtin_command
(
const
vector
<
string
>&
args
);
void
handle_noemi
(
const
vector
<
string
>&
args
);
...
...
@@ -60,17 +77,18 @@ void handle_tap(const vector<string>& args);
void
handle_crush
(
const
vector
<
string
>&
args
);
void
handle_mkdir
(
const
vector
<
string
>&
args
);
void
handle_rn
(
const
vector
<
string
>&
args
);
void
handle_snatch
(
const
vector
<
string
>&
args
);
void
handle_exec
(
const
vector
<
string
>&
args
);
/**
* The main
code
* The main
function
*/
int
main
()
{
cout
<<
"Noemi Shell (nosh)
\n
"
;
cout
<<
"Copyright (C) 2025 Zsombor Szabo-Antalovszky
\n\n
"
;
cout
<<
"Noemi Shell (nosh)
\n
"
<<
"Copyright (C) 2025 Zsombor Szabo-Antalovszky
\n\n
"
<<
"Type 'help' or '? for list of available commands
\n\n
"
;
string
command
;
// Storing command
...
...
@@ -115,7 +133,7 @@ int main() {
continue
;
}
//
Example:
Handling unrecognized commands
// Handling unrecognized commands
if
(
!
is_builtin_command
(
args
))
{
cout
<<
"Unrecognized command: "
;
for
(
const
auto
&
arg
:
args
)
{
...
...
@@ -129,6 +147,28 @@ int main() {
return
0
;
// Terminate program with success
}
void
handle_help
(
const
vector
<
string
>&
args
){
if
(
args
.
size
()
<
1
){
cout
<<
"help: too many arguments
\n
"
;
return
;
// Exit early
}
cout
<<
"about: Displays shell information
\n
"
<<
"about --version: Displays shell version only
\n
"
<<
"exec: Execute an executable file
\n
"
<<
"exit: Exit the shell
\n
"
<<
"grasp -d: Search through directories for other directories
\n
"
<<
"grasp -f: Search through directories for files
\n
"
<<
"list: List the files or other directories whithin a directory
\n
"
<<
"mkdir: Create a new directory whithin current directory
\n
"
<<
"noemi: Draw a heart shape made of # characters
\n
"
<<
"noemi -l: Draw a heart shape made of # characters with more delay
\n
"
<<
"rn: rename a file or a directory
\n
"
<<
"store: Save a string of maximum 100 characters during runtime
\n
"
<<
"store -g: Show the string saved with store
\n\n
"
;
}
/**
* Runs executable files using the 'system' function
...
...
@@ -146,7 +186,6 @@ void handle_exec(const vector<string>& args){
system
(
path
.
c_str
());
// Runs the executable
}
/**
* Handling the 'pwd' command for printing the working directory
*
...
...
@@ -216,6 +255,26 @@ bool is_builtin_command(const vector<string>& args){
return
true
;
}
if
(
args
[
0
]
==
"cls"
){
if
(
args
.
size
()
>
1
)
{
cout
<<
"clear: too many arguments"
;
return
true
;
}
system
(
"cls"
);
return
true
;
}
if
(
args
[
0
]
==
"help"
){
handle_help
(
args
);
return
true
;
}
if
(
args
[
0
]
==
"?"
){
handle_help
(
args
);
return
true
;
}
if
(
args
[
0
]
==
"noemi"
){
handle_noemi
(
args
);
...
...
@@ -286,7 +345,7 @@ bool is_builtin_command(const vector<string>& args){
void
handle_noemi
(
const
vector
<
string
>&
args
){
if
(
args
.
size
()
>
2
){
cout
<<
"Usage: noemi <delay
argument>
"
;
cout
<<
"Usage: noemi <
optional_
delay
_
argument>
\n
"
;
return
;
// Exit early
}
...
...
@@ -296,17 +355,18 @@ void handle_noemi(const vector<string>& args){
if
(
args
.
size
()
==
2
){
const
string
option
=
args
[
1
];
// Set the option variable to the first argument
if
(
option
==
"-l"
)
time
=
500
;
// 500 milliseconds between each line
if
(
option
==
"-l"
){
time
=
500
;
// 500 milliseconds between each line
}
else
{
cout
<<
"noemi: unrecognized argument "
<<
args
[
1
]
<<
"
\n
"
;
return
;
// Exit early;
}
}
cout
<<
"
\n\t
#######
#######
\n
"
;
cout
<<
"
\n\t
#######
##
#######
#
\n
"
;
Sleep
(
time
);
cout
<<
" ########### ###########
\n
"
;
cout
<<
" ###########
#
###########
\n
"
;
Sleep
(
time
);
cout
<<
" ############### ###############
\n
"
;
Sleep
(
time
);
...
...
@@ -405,6 +465,8 @@ void handle_cd(const vector<string>& args) {
cout
<<
"cd: "
<<
new_path
<<
": No such directory
\n
"
;
}
}
}
/**
...
...
This diff is collapsed.
Click to expand it.
nosh.exe
deleted
100644 → 0
+
0
−
0
View file @
83e2bfb6
File deleted
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment