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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsombor Szabó-Antalovszky
Noémi Shell X
Commits
83e2bfb6
Commit
83e2bfb6
authored
4 months ago
by
My Name
Browse files
Options
Downloads
Patches
Plain Diff
Added new command and updated readme
parent
aea802c6
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.vscode/settings.json
+5
-0
5 additions, 0 deletions
.vscode/settings.json
README.md
+8
-6
8 additions, 6 deletions
README.md
nosh.cpp
+25
-6
25 additions, 6 deletions
nosh.cpp
nosh.exe
+0
-0
0 additions, 0 deletions
nosh.exe
with
38 additions
and
12 deletions
.vscode/settings.json
0 → 100644
+
5
−
0
View file @
83e2bfb6
{
"files.associations"
:
{
"vector"
:
"cpp"
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
README.md
+
8
−
6
View file @
83e2bfb6
...
...
@@ -9,6 +9,8 @@ Nosh is a simple, customizable command-line shell designed for Windows systems.
`about --version`
: Display the version of the shell.
`exec`
: Execute executable files.
`exit`
: Exit the shell program.
`grasp`
: Search through directories for files or directories. Supports:
...
...
@@ -19,17 +21,17 @@ Nosh is a simple, customizable command-line shell designed for Windows systems.
`list`
: Display the contents of a directory or the current working directory.
`mkdir`
: Create a new directory. Usage:
`mkdir <directory_name>`
`mkdir`
: Create a new directory. Usage:
`mkdir <directory_name>`
.
`noemi`
: Draw a heart shape made of # characters
`noemi`
: Draw a heart shape made of # characters
.
`noemi -l`
: Draw a heart shape made of # characters with more delay
`noemi -l`
: Draw a heart shape made of # characters with more delay
.
|
`rn (rename)`
: Rename a file or directory. Usage:
`rn <old_name> <new_name>`
`store`
: Save content to a specified file. This could be used to store commands or data for later use.
`rn (rename)`
: Rename a file or directory. Usage:
`rn <old_name> <new_name>`
.
`store`
: Save a string of maximum 100 characters during runtime.
`store -g`
: Show the string saved with
`store`
.
## Installation
...
...
This diff is collapsed.
Click to expand it.
nosh.cpp
+
25
−
6
View file @
83e2bfb6
...
...
@@ -35,8 +35,9 @@
#include
<fstream>
// Reading/Creating files
#include
<cstring>
// String operations
#include
<regex>
// For grasp filtering
#include
<cstdlib>
#define VERSION 0.3
//< Change version number here for the entire code
const
char
VERSION
[]
=
"0.3.1"
;
//< Change version number here for the entire code
#define STRLEN 100 //< Max string length
char
vault
[
STRLEN
];
//< Storing custom info;
...
...
@@ -59,7 +60,8 @@ 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
...
...
@@ -127,11 +129,23 @@ int main() {
return
0
;
// Terminate program with success
}
/**
*
F
un
ction for handling the pwd command
*
* @param args for
the
arguments
*
R
un
s executable files using the 'system' function
*
* @param args for arguments
*/
void
handle_exec
(
const
vector
<
string
>&
args
){
if
(
args
.
size
()
!=
2
){
cout
<<
"Usage: exec <file_to_execute>
\n
"
;
return
;
// Exit early
}
string
path
=
args
[
1
];
system
(
path
.
c_str
());
// Runs the executable
}
/**
* Handling the 'pwd' command for printing the working directory
...
...
@@ -213,6 +227,11 @@ bool is_builtin_command(const vector<string>& args){
return
true
;
}
if
(
args
[
0
]
==
"exec"
){
handle_exec
(
args
);
return
true
;
}
if
(
args
[
0
]
==
"list"
)
{
handle_list
(
args
);
return
true
;
...
...
@@ -433,7 +452,7 @@ void handle_storage(const vector<string>& args) {
cout
<<
"Enter text to store in memory (MAX 100 characters): "
;
cin
.
getline
(
vault
,
STRLEN
);
// Use getline to capture input
cout
<<
"Storing:
\"
"
<<
vault
<<
"
\"
in memory.
\n
"
;
}
else
if
(
args
.
size
()
==
2
&&
args
[
1
]
==
"g
et
"
)
{
}
else
if
(
args
.
size
()
==
2
&&
args
[
1
]
==
"
-
g"
)
{
// Retrieve stored text
if
(
strlen
(
vault
)
==
0
)
{
cout
<<
"No text stored in memory.
\n
"
;
...
...
This diff is collapsed.
Click to expand it.
nosh.exe
0 → 100644
+
0
−
0
View file @
83e2bfb6
File added
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