Skip to content

Commit a8e9143

Browse files
committed
refactor: moved some types from variables module to types module and updated Variable object definition
FossilOrigin-Name: 3c546934c181ffd6a60d4558bfcdc96c81585fea6fab47ec3333361651d61ef6
1 parent 735261b commit a8e9143

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/types.nim

+9-3
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ type
152152
VariableValType* = enum
153153
## Used to set the type of variable's value
154154
path, text, number
155+
VariableName* = string
156+
## Used to store variables names in the database
157+
VariableValue* = string
158+
## Used to store variables' values
159+
VariableDescription* = string
160+
## Used to store variables' descriptions
155161
Variable* {.tableName: "variables".} = ref object of Model
156162
## Data structure for the shell's environment variable
157163
##
@@ -160,12 +166,12 @@ type
160166
## * recursive - if true, the variable is available also in subdirectories
161167
## * value - the value of the variable
162168
## * description - the description of the variable
163-
name*: string
169+
name*: VariableName
164170
path*: Path
165171
recursive*: bool
166-
value*: string
172+
value*: VariableValue
167173
varType*: VariableValType
168-
description*: string
174+
description*: VariableDescription
169175
ResultCode* = distinct Natural
170176
## Used to store result code from commands entered by the user
171177
CommandName* = string

src/variables.nim

-6
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@ const
4545
'n': "number", 'q': "quit"}.toTable
4646
## The list of available options when setting the type of a variable's value
4747

48-
type
49-
VariableName = string
50-
## Used to store variables names in the database.
51-
VariableValue = string
52-
## Used to store variables' values
53-
5448
using
5549
db: DbConn # Connection to the shell's database
5650
arguments: UserInput # The string with arguments entered by the user for the command

0 commit comments

Comments
 (0)