-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05ea58d
commit d459ffa
Showing
4 changed files
with
75 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/** | ||
** This file is part of BoneOS. | ||
** | ||
** BoneOS is free software: you can redistribute it and/or modify | ||
** it under the terms of the GNU General Public License as published by | ||
** the Free Software Foundation, either version 3 of the License, or | ||
** (at your option) any later version. | ||
** BoneOS is distributed in the hope that it will be useful, | ||
** but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
** GNU General Public License for more details. | ||
** You should have received a copy of the GNU General Public License | ||
** along with BoneOS. If not, see <http://www.gnu.org/licenses/>. | ||
** | ||
** @main_author : Ashish Ahuja | ||
** | ||
** @contributors: | ||
** Ashish Ahuja<Fortunate-MAN>: start | ||
**/ | ||
|
||
#include <misc/status_codes.h> | ||
#include <sh/shell.h> | ||
#include <drv/video/video.h> | ||
#include <unistd/unistd.h> | ||
#include <stdio/stdio.h> | ||
#include <sh/values.h> | ||
#include <pwd/pwd.h> | ||
|
||
struct cmd_opt_t* cmd_pwd_opts[] = | ||
{ | ||
0 | ||
}; | ||
|
||
int cmd_pwd_handler (char *cmd) | ||
{ | ||
size_t num_opts = get_opt_count (cmd); | ||
if (num_opts > 2) | ||
{ | ||
printk(cmd_pwd.invalid_use_msg); | ||
return STATUS_OK; | ||
} | ||
printk ("%s", VAR_PWD); | ||
printk ("\n"); | ||
return STATUS_OK; | ||
} | ||
|
||
struct cmd_t cmd_pwd = | ||
{ | ||
.name = "pwd", | ||
.usage ="pwd", | ||
.help = "pwd(1) \t\t\t\t BoneOS Terminal Manual \n" | ||
"NAME : \n " | ||
"\tpwd\n" | ||
"SYNOPSIS : \n " | ||
"\tpwd\n" | ||
"DESCRIPTION : \n " | ||
"\tPrints out the current working directory.\n", | ||
.cmd_opts = cmd_pwd_opts, | ||
.handler = &cmd_pwd_handler, | ||
.invalid_use_msg = "Invalid use of pwd command.\n" | ||
"Type in pwd --help for more help.\n", | ||
.privilege = USER | ||
}; |
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 @@ | ||
extern struct cmd_t cmd_pwd; |