diff --git a/app/Main.hs b/app/Main.hs
--- a/app/Main.hs
+++ b/app/Main.hs
@@ -15,17 +15,12 @@
 import System.Directory
 import System.Directory.Internal
 import System.FilePath.Posix
+import System.Environment
 
 main :: IO ()
 main = do
   pwd <- getCurrentDirectory
-  files <- listDirectory pwd
-  let name =
-        if  | any (("dist-newstyle" ==) . takeFileName) files -> "cabal"
-            | any ((".stack-work" ==) . takeFileName) files -> "stack"
-            | any (("cabal.project" ==) . takeFileName) files -> "cabal"
-            | any (("stack.yaml" ==) . takeFileName) files -> "stack"
-            | otherwise -> "cabal"
+  name <- resolveName pwd
   cfs <- runMaybeT $ case name of
     "cabal" -> cabalPkgs pwd
     _ -> stackYamlPkgs pwd
@@ -35,3 +30,19 @@
       <> "\n You may need to run stack build."
   pkgs <- catMaybes <$> mapM (nestedPkg pwd) (concat cfs)
   putStr <$> hieYaml name $ fmtPkgs name pkgs
+
+resolveName :: FilePath -> IO String
+resolveName pwd = do
+  args <- getArgs
+  files <- listDirectory pwd
+  let fileNames = map takeFileName files
+      name =
+        if  | "--cabal" `elem` args -> "cabal"
+            | "--stack" `elem` args -> "stack"
+            | "dist-newstyle" `elem` fileNames -> "cabal"
+            | ".stack-work" `elem` fileNames -> "stack"
+            | "cabal.project" `elem` fileNames -> "cabal"
+            | "stack.yaml" `elem` fileNames -> "stack"
+            | otherwise -> "cabal"
+  return name
+
diff --git a/implicit-hie.cabal b/implicit-hie.cabal
--- a/implicit-hie.cabal
+++ b/implicit-hie.cabal
@@ -7,7 +7,7 @@
 -- hash: b2b829a658e33ea328c725dea732391089d03ffd2a216d413a75d88aefa7c181
 
 name:           implicit-hie
-version:        0.1.1.0
+version:        0.1.2.0
 description:    Auto generate a stack or cabal multi component hie.yaml file
 category:       Development, Tools, Hie, HLS
 synopsis:       Auto generate hie-bios cradles & hie.yaml
diff --git a/src/Hie/Cabal/Parser.hs b/src/Hie/Cabal/Parser.hs
--- a/src/Hie/Cabal/Parser.hs
+++ b/src/Hie/Cabal/Parser.hs
@@ -121,9 +121,10 @@
     <|> (skipBlockLine i >> pathMain i p m o a)
     <|> pure
       ( map (<//> m) p
-          <> [ p' <//> (o' <> ".hs")
+          <> [ p' <//> (o'' <> ".hs")
                | p' <- p,
-                 o' <- filter (`notElem` a) o
+                 o' <- filter (`notElem` a) o,
+                 let o'' = T.replace "." "/" o'
              ]
       )
 
diff --git a/src/Hie/Locate.hs b/src/Hie/Locate.hs
--- a/src/Hie/Locate.hs
+++ b/src/Hie/Locate.hs
@@ -31,7 +31,7 @@
   deriving (Eq, Ord)
 
 instance FromJSON Pkgs where
-  parseJSON (Object v) = Pkgs <$> v .: "packages"
+  parseJSON (Object v) = Pkgs <$> v .:? "packages" .!= ["."]
   parseJSON _ = fail "could not read packages from stack.yaml"
 
 stackYamlPkgs :: FilePath -> MaybeT IO [FilePath]
diff --git a/src/Hie/Yaml.hs b/src/Hie/Yaml.hs
--- a/src/Hie/Yaml.hs
+++ b/src/Hie/Yaml.hs
@@ -50,6 +50,7 @@
     <> "component: "
     <> dQuote c
 
+-- | Same as init but handle empty list without throwing errors.
 dropLast :: [a] -> [a]
 dropLast l = take (length l - 1) l
 
diff --git a/test/Spec.hs b/test/Spec.hs
--- a/test/Spec.hs
+++ b/test/Spec.hs
@@ -90,6 +90,13 @@
     $ it "list with leading commas"
     $ ("one\n , two\n , three3" :: Text) ~> parseList 1
       `shouldParse` ["one", "two", "three3"]
+  describe "Should Succeed"
+    $ it "succesfully parses exe component with other-modules containing dots"
+    $ exeSection2 ~> parseExe 0 
+      `shouldParse` [ Comp Exe "gen-hie" "app/Main.hs"
+                    , Comp Exe "gen-hie" "app/Hie/Executable/Helper.hs"
+                    , Comp Exe "gen-hie" "app/Hie/Executable/Utils.hs"
+                    ]
 
 exeSection :: Text
 exeSection =
@@ -175,3 +182,13 @@
   \  , text\n\
   \  default-language: Haskell2010\n\
   \"
+
+exeSection2 :: Text
+exeSection2 =
+  "executable gen-hie\n\
+  \  other-modules:\n\
+  \    Hie.Executable.Helper\n\
+  \    Hie.Executable.Utils\n\
+  \  hs-source-dirs:\n\
+  \      app\n\
+  \  main-is: Main.hs \n"
