Skip to content

Commit

Permalink
New Args[]
Browse files Browse the repository at this point in the history
  • Loading branch information
eloaders committed Jul 26, 2014
1 parent 182fc32 commit 35f6cfe
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 82 deletions.
8 changes: 5 additions & 3 deletions I-Nex/i-nex/.src/Finfosys.class
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,11 @@ Public Sub Wykrywanie_procesorow()
Dim CPU_CACHE_ALIGNMENT As New String[]
Dim CPU_ADRESS_SIZES As New String[]
Dim CPU_POWER_MANAGEMENT As New String[]

CPUINFO_PROC = Open "/proc/cpuinfo"

If IsNull(MStart.CPUINFO_FILE) = True Then
CPUINFO_PROC = Open "/proc/cpuinfo"
Else
CPUINFO_PROC = Open MStart.CPUINFO_FILE
Endif
For Each sLine In CPUINFO_PROC.Lines
sLine = Trim(sLine)
If Not sLine Then Continue
Expand Down
43 changes: 43 additions & 0 deletions I-Nex/i-nex/.src/MStart.module
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
' Gambas module file

Public CPUINFO_FILE As String
Public Sub Main()
Dim PrintErr As Boolean = True
Select Case Application.Args[1]
Case "--help"
Print ("\n " & Application.name & " " & Application.version & " running on:\n"
"\n Architecture: " & System.Architecture & ""
"\n"
"\n System Family: " & System.Family & ""
"\n Gambas Version: " & System.FullVersion & ""
"\n System Charset: " & System.Charset & ""
"\n Hostname: " & System.Host & ""
"\n "
"\n Usage: env VARIABLE=\"STRING\" " & Application.name & ".gambas [Options]"
"\n Options:"
"\n --help (Chow Help)"
"\n"
"\n Env Variables:"
"\n"
"\n INEXCPU_VENDOR"
"\n"
"\n Example:"
"\n"
"\n env INEXCPU_VENDOR=\"Pentium(R) Dual-Core CPU T4200 \" ./i-nex.gambas")
Case "--about"
About.Show
PrintErr = False
Case "--cpuinfo"
CPUINFO_FILE = Application.Args[2]
Finfosys.Show
PrintErr = False
Case ""
Finfosys.Show
PrintErr = False
End Select
If PrintErr = True Then
Print ("\nInvalid arguments\n"
"Use --help to show options\n")
Endif

End
65 changes: 0 additions & 65 deletions I-Nex/i-nex/.src/Start_App_Args.class

This file was deleted.

14 changes: 0 additions & 14 deletions I-Nex/i-nex/.src/Start_App_Args.form

This file was deleted.

0 comments on commit 35f6cfe

Please sign in to comment.