Documentation!

This commit is contained in:
Kat R. 2022-10-09 11:46:07 -05:00
parent a9e7490a87
commit d91b47b1e2

10
pwd.c
View file

@ -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) {