Skip to content

Commit

Permalink
Ajout de la commande LOGNAME
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylvain Maltais committed May 8, 2022
1 parent 5398af7 commit b38d86f
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions LOGNAME.PAS
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{ @author: Sylvain Maltais ([email protected])
@created: 2022
@website(https://www.gladir.com/unix-0)
@abstract(Target: Turbo Pascal, Free Pascal)
}

Program LOGNAME;

Uses DOS;

Function StrToLower(S:String):String;
Var
I:Byte;
Begin
For I:=1 to Length(S)do Begin
If S[I] in['A'..'Z']Then S[I]:=Chr(Ord(S[I])+32);
End;
StrToLower:=S;
End;

BEGIN
If(ParamStr(1)='/?')or(ParamStr(1)='--help')or(ParamStr(1)='-h')or
(ParamStr(1)='/h')or(ParamStr(1)='/H')Then Begin
WriteLn('LOGNAME : Cette commande permet de demander le nom de connection.');
WriteLn;
WriteLn('Syntaxe : LOGNAME');
End
Else
Begin
WriteLn(StrToLower(GetEnv('USERNAME')));
End;
END.

0 comments on commit b38d86f

Please sign in to comment.