Documentation!
This commit is contained in:
parent
a9e7490a87
commit
d91b47b1e2
1 changed files with 9 additions and 1 deletions
10
pwd.c
10
pwd.c
|
@ -5,7 +5,15 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
int main(int argc, char * argv[]) {
|
int main(int argc, char * argv[]) {
|
||||||
int mode = 01; /* 01: print PWD -L, 02: print physical path -P */
|
/*
|
||||||
|
The -L option prints the logical path, corresponding to the PWD envar.
|
||||||
|
-P prints the physical path. The logical path includes any symbolic
|
||||||
|
links followed to get there, where as the physical path doesn't. So,
|
||||||
|
for example, if /lib links to /usr/lib, then if we cd /lib, pwd -L will
|
||||||
|
print /lib, whereas pwd -P will print /usr/lib, even though cd .. will
|
||||||
|
take us back to /
|
||||||
|
*/
|
||||||
|
int mode = 01; /* 01: -L, 02: -P */
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
while((c = getopt(argc, argv, "LP")) != -1) {
|
while((c = getopt(argc, argv, "LP")) != -1) {
|
||||||
|
|
Loading…
Reference in a new issue