Documentation!

This commit is contained in:
Kat R. 2022-10-09 11:46:07 -05:00
parent a9e7490a87
commit d91b47b1e2
1 changed files with 9 additions and 1 deletions

10
pwd.c
View File

@ -5,7 +5,15 @@
#include <stdlib.h>
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;
while((c = getopt(argc, argv, "LP")) != -1) {