Object subclass: #Arguments instanceVariableNames: 'dict' classVariableNames: '' poolDictionaries: '' category: nil ! Arguments comment: 'I am a simple argument parser' ! !Arguments class methodsFor: 'instance creation'! new | r | r := super new. r init. ^r ! ! !Arguments methodsFor: 'instance initialization'! init dict := Dictionary new. dict at: $t put: 10; at: $p put: 32; at: $n put: 32. Smalltalk doGetopt: 'vp:n:a:t:' put: dict. ! ! !Arguments methodsFor: 'argument access'! verbose ^dict includesKey: $v. ! pagesize ^(dict at: $p) asInteger. ! numpages ^(dict at: $n) asInteger. ! timestep ^(dict at: $t) asInteger. ! algorithm ^dict at: $a ifAbsent: [^self error: 'Algorithm not specified']. ! args ^dict at: 'args' ifAbsent: [ #() ]. ! !